{"_id":"piral-pwa","_rev":"821-b64df792d2c79dd0c3916cdbfb29c7e5","name":"piral-pwa","dist-tags":{"canary":"0.15.0-alpha.4409","next":"0.15.13-beta.5591","latest":"0.15.13"},"versions":{"0.9.0-pre.739":{"name":"piral-pwa","version":"0.9.0-pre.739","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.739","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"df681b6f1497bb56dfc8a7cc5819606eb6ece1d6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.739.tgz","fileCount":20,"integrity":"sha512-XplNSQLee6TghSH2oFzAQKU3qshgd8xcIlLxPT4zgmz88+yX73cRlAV8VBL4jxuM/OgZhvm5fL+CAQOLq2wHVA==","signatures":[{"sig":"MEQCIBhsiIXdIX8fZBZ+4cX1egVkVtmQOTAcIvZCs8QC0v4qAiA8ZZbn2zSvgV/O+32fgzfggCok4Vdtt28zQhcA49df1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyf0DCRA9TVsSAnZWagAAiaMP/1wp/xaeWG/BJA8PFJ5j\nHfGxjOt1A2cNSQPCUQw0Qn11MRPsBPxH9C9WlWjm/KGUHoYsc9+toGykHcJY\n2ryZ9hTh0tfGC9aecUjIjGOgQ1N6s8BSx4hoI7FimTei+gUGZN555ssuJbRn\nVJ/ohfRXr+oHjq6UYw75JkalmrzgesbPinTxBdQSvXpUkPpmoxehcOOCKMlG\nkol81onA+5i9w+5oWjay2iQujPObYAaTB9gN7DYIrjY/SFpm8czpUuPDzIbJ\nHMeedQH68TH/f4CRqvLi9qSIi/TDFOTKqctcZ5Xznys4xmb1BBvzsd0rj4lY\nB2fNdx7Ysrb9NjQUGGEglgLCSFvGKDUymsxBCH40iDIWn2U2OBR2zL+HuOnG\nagxT9BFUil5QlSSF0NzIsHshLoiuHyW8loptglyp9bpwRtFbvSPCiUmMlO2S\n6Mr3V1kpfRYjtkxxib27gISBrw6KjmlARAw/wny9CK9c1ZA/2uXR8f109d/o\nK1A8Srb48JMUzsQz4h5ZLioQcWQq7TMcUkVGpPH2QB8kjAYz4AN/QYAfZc9q\nFFRM0rGQTlxDOKU4xovIkvDUhqC0/NkVo74SDPmeF9gX1rEvTSOXy3YaGojJ\npwqEKKdrDLjKx7IUctAjLIWLT3zaDu8EZhsdbAK5UGR7h0j2ZMX5CAOUIp6M\nxGfx\r\n=PiFI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"92414f91e86075e1bddcfcb3f838a61fee60888e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.0-pre.739"},"peerDependencies":{"piral-core":"^0.8.0 || ^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.739_1573518594805_0.7028361332898985","host":"s3://npm-registry-packages"}},"0.9.0-pre.741":{"name":"piral-pwa","version":"0.9.0-pre.741","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.741","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a7e48ef8dbcd59c3fca5c465ad8cdffcd925a89b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.741.tgz","fileCount":20,"integrity":"sha512-BzGotsnhGcVqecmx9YC/+fK3Qs0I4EoklnPr1moNqJTQVJRmRl79J/WD7z00Zxv2Mxg3+Nkc+LkeA2hPxXR09w==","signatures":[{"sig":"MEQCIHh/h/nYB9yqupMi1Jo8cr/ylQLNP/5kifGAD6SYYCb2AiBAJWENXkv8QjFDXS10YvzPp7BqcUeYraIIyajkkcS45A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzBNYCRA9TVsSAnZWagAA+50P/2BYdgxPcnSFwsa9T642\nNX71QB3GDeaRWnUfLmdrdeJfJ0jKrgJMnSt2RC8L/ztfyqF9b846z9ynJ8tr\nsWHknfLXwFbPwjtw/PDIsMrk2FLAyXV5HrzxzKmXh5fQjgZ4yUvVC+k8vUWw\n6GCmiGvi1pyB+VD4Qs16ndp19WpCTkJ8rFUyUVKIohh/pFVeSd+0rR+PjRZZ\nLSPUmUk5CU9b0usC18eggFI+hx1qVoj96mTXLB7DZMcgxjc04vHSDr7GwBY+\nnT8SIBsOx9JatQzEMB5WX0DGpP2DL8zJ1ACYGswTsH4SdtmZ2YnCn3guqt6C\nclywcmm/sXAgcMum25+Zf76ZWG4Ip20G/bLUaEaaSu5uP88JB7NtAY3/Jft3\nco1K+YUq/HHFVwl1gL5+sr4yn18r6WpFUgJubAKqqO8xFJWIYbiHRUuhJUmH\nl2tQywscV8g8b/PiP3smJLxF2LImKyo1tZtJp0BdWJEm2vJqRBtv6O/K5wJ1\n+0sHSeYaz61R6lzVMwlg9TULvUQOpiSUlXY66bwTg+xrtnmrz3iP43xxmguF\nyTOPw57EJ6f1IvDHuUPsdckYNKkohGCYweiJJhFDIOZ4w7kf2t8IO/b3mBqN\nSfOneYakiyh3ApAnl+Q71vqO8uPofwfxZHdzkmeGGdLLcERyETaFaDhSulwQ\n7vuw\r\n=954i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"37356202d903fbbae177da4449f2daa4cd6880d0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.741"},"peerDependencies":{"piral-core":"^0.8.0 || ^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.741_1573655383660_0.14114509072040193","host":"s3://npm-registry-packages"}},"0.9.0-pre.742":{"name":"piral-pwa","version":"0.9.0-pre.742","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.742","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4ba1a65fc4735461e43ab768bbf884476b25f4cd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.742.tgz","fileCount":20,"integrity":"sha512-dUSDqr2aEle51GcQn99krGx5P4BgX0nxi6efkD2i55kbmzsuiA8GQq25ndUz1E5HWX8Z45q39O7hdBa2HWY85Q==","signatures":[{"sig":"MEYCIQCRIkE6hwRi9jV6P5OPIoNWyX57/Y/jMh9udBAbd0a7wwIhAOGePxMOQne0Crkf6+wSBgMRYMcqeEocp2sIYJDnuZaj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzqJZCRA9TVsSAnZWagAA8lwP/jwgUAeKBtQ6MOap+fEP\nqSWU55VzWAaXhBFSjAG1OiPkkk7fbSMVwOyaCswct9knnq3iU+9acfEK3gXz\nUTcuvuEtYKNs32FBs0Zbefu2aH/uWUv3Aho1DVwAET7rt0T0iYtcd2ZcxN3v\nIYUKlWTSCiYcZayE/U86LPT1iUCQfh5BExRddXyJ7BoXLTYRGjBT/i6ola5k\nyXxzI+rb7sK5h63MyAz1DJTbxd0lEOvwrC+grLlKnCUTazj5gN39IUiqkAFD\nEc/2PriTevepljodSxgptIZW4HwjvbsdNi6E1haau8eKJeCr5qwWD+Mv9pop\nyVRvK88O76Qh8y26Z+rtqgoWUG9vTK0zwfg0EDTKZMETClU73mjKDQzASoB3\nuT0ku0EDShxRbj45Szjtooafiq+zUutqax/tyGgIHk+trF3ne8HccpWvThGc\nOqqYVDF6d9lKD6+F3G+t5x0mmw0DZU1famXkI085al+EILyD1CUZtzZuvcuB\nyIPNligp3RFPr/rWX3YHPj0vkjoBx+B3lhuuU/r6etqgeEaDIZZ0RJaQB0UG\nnt2Ytu9LgRi0T1cMKBcjSx3wpngLZJI/zGuuh2QpTjqoTr+2XbUY4SwTja4N\neEyMkdF1V3Z82PFASDNilmm5/O1qw89cR1shuWy+pSiW7kSYHkO3JfaYMy+m\nJxud\r\n=CYjj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c3b05a857317462e238b03ff553952b24b0c17c6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.742"},"peerDependencies":{"piral-core":"^0.8.0 || ^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.742_1573823065034_0.005481617782093107","host":"s3://npm-registry-packages"}},"0.9.0-pre.746":{"name":"piral-pwa","version":"0.9.0-pre.746","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.746","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e5cd5439f7d37d2283f45da0b6499d4ea0f1f205","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.746.tgz","fileCount":20,"integrity":"sha512-5iT1tHO5VgVUTIrlex2ys1IsSQtlrhCe/RP0IIsNtSp6luQJkKDCEo2ruFFpehGJXN+uHctxSOqfMh7TFUxPig==","signatures":[{"sig":"MEUCIFtIDR4U0C/Lss4Wj94I7xWjUQtXmv/tSRr733IcoDyOAiEA+xNiknDWbeqPZ6dB7JWQvHPXcnVEWWjBQxAbX/9zXSs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0K2FCRA9TVsSAnZWagAAJQMP/i5CwKf3Ya/+hDtTOlpd\n2/Yzl93IXf7tT2lsGkmtPhUKgehbX+axJ8K1zQ6T9/zergEEmNOUOtn3+LvZ\nnwVQlKlggS8BJ1ixmrGKDi1FzLUIuSFzKc3QHPZhEkjak1X8YPhJAIsMKrgA\nXJAsJQ8b8vHb6FtkTA8vX6+fNz3AMF3W81sqkbIaKU8+g4bM8x+0ML5S8oKs\nWlLZHn5W3SqVM8J+SfoKmVEBybPkusq8JcP8dLlEf2td6sr7iL8uIbivSvW8\nc2ujawHAc1ob2nsnviooHKeZl5Dme2IlvypwmZKdqZysgj3LJGrsDrxDz664\np4CD854asvGTt61oAkfADFZeYtLlsmT6J3/D1Oqiot7RddhfTd/0kmR9IHj6\n6hDDIqKgAYsD7A5dL4oyNmJUmVPijxbKwu0w5AMyitNbvWnCYnsAdoA4IDUJ\nZO5HGn5uF1oPhLG9ECj1jswOAoXeudk6oSWmUWd7NmcVjsDp365LG5Z/35uq\nGbMqFUx+33EKbI/0xivFErMJlEVfi3zMUMuGZa+uGTtCsIuIwPmaNR4z+LHc\nSFHby+1UhUNrNbdnvAfaZP05pHwo6F95VSHMgCWzSj6jjAZHjLyuZGiJUYhr\nCmHxlsP2NpqsQY94ri0DBIL1nmdl/B/Tz9EidC4AaaUV7YdTG5Hci8Im8bRt\nlOoI\r\n=12kt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d79bf9b30d1f80473bbd6cb8225cbb1156ecb7d7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.746"},"peerDependencies":{"piral-core":"^0.8.0 || ^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.746_1573956997288_0.44837593333768355","host":"s3://npm-registry-packages"}},"0.9.0-pre.751":{"name":"piral-pwa","version":"0.9.0-pre.751","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.751","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"19cfb9475135ab01b9cf5250ffaf603c651f2838","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.751.tgz","fileCount":20,"integrity":"sha512-KEkE3uWwvSb+yvspbC7Fy7+SdV7PyKFlZ7XA8hYEcfexCQz1SORPgf6yh735KjfyYKhurIIASJWfuawUo8yuMw==","signatures":[{"sig":"MEYCIQCGyWzynu4/25xz+cNQ4e2wnZ6BifqFMnyUZ4Iie/kZtwIhAOkQ235hLBlB/JxtDzeXmfHCYQ9id+4FhMSwngaiRl/S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd27QxCRA9TVsSAnZWagAAOm0P/iXJnom2C0NeSRo1DL0N\nAPk/th2yhs3JmCGT1BUZvmhkzGqlM0uTUZKgRA1QiT4g1Yg+Ch0fYQsbBVnG\nlbied6k2/3I/K78jeDh0w+CZE168fbBlpZcSTS7gaSWt596jW48uGOg4uvOs\nAYfrnTqGlM9Vy+FJZwyjtxfm4M3jyPqCRhBgO2xQFLmg4FOz55Oh6Qqno+NU\nfwZk3TwhdAOlnSrluqu9E1ooY8Q/2fS8w6GPuErTKygHN/R1XByusBNwz+l3\nVmZeRDQrrkGAH2gvBFfYnn96AMii0xr67gofg5Wf48c87xkN7ykMWRX1ZQjd\nddHgYd+3TTBAf4r5TyVBGb+z1oZPqPswq1XG2R1CJ75f0Zv8r5BW8MrSOV4S\nIL438HQVZW9e/dy0HDKmp2w66tEpWXXlDacvDqy2b848ISUKJwn9cDA+HAPP\n+QUUzC9k3PBCkpn7oT9ns6KX9xxLO99CeHY3anZIBrXsFSWuL8eI8R9gVyoS\ncaKZCkavVvYbFyZQwklv49DOjrhygcXCzG/TgpuQvAAxDyB+1Ekebsb4FcXh\nmlJyK4CqyyB0p49/cccu+hzy4bzRIK0NrrLgLYbJpq7zlVmf/N+k/un4Tgz9\nOoU/jgorkUY6fLeidE9bZakTlikySviR4RKqHcjYpYEyjt9yNhqMlaJK7cSz\nVuRI\r\n=PfeL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"461d07d5b5d1f7a3d9512b933f065ea100762889","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.751"},"peerDependencies":{"piral-core":"^0.8.0 || ^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.751_1574679600921_0.7593606809430375","host":"s3://npm-registry-packages"}},"0.9.0-pre.754":{"name":"piral-pwa","version":"0.9.0-pre.754","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.754","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"418875da2dea6947076a5609a3066300116ca783","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.754.tgz","fileCount":20,"integrity":"sha512-8nQ8lO+t0tLOZa+x0LsUAaGWmsol3zv4SH66sRiU3qpdFxHtfqa3r982gEaeD2J64pmneKN8M6/AUHC6cmu6YQ==","signatures":[{"sig":"MEYCIQCuzMoY0ptXoHVVifrcfvwmP6jt5Zf4xZOHA2zo1k3qTAIhAMJkznAgBqMq3tYmdVeMt875Go2c1UpQVtCLuub9Jnxo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3M2uCRA9TVsSAnZWagAALPgP/RVkswL2gM9+S/otcAYj\nisvhGiNaIX6zrGuVsjkeIItVJkSer+CjbgKT8hsHjAaM+6AlWgRAep6OjqzN\nCRah6LxCDG5iBuw5wprMX21c5FRHx6ka5VLk1en8+wzX9mA3C/DCyiXwFwbQ\n9t43Vntc/3bqj08aCAS466Ne54kOAq+L2MNgv74TseywKRb19CHDV9IxE/g6\nNRjX+R2fPvjpAujtlcjHVvl4G4gAl3Bv/Gvi257rQPJfGE67uqe9hFl7vCvr\nH9xTgr+TD5X6Sy5Ogo9s0gFqIVKP9oWZ7kSVtxGB+5146CfZS5TmSs1jKqBW\nbRc8p6qbrb5/4nZggauWPxXeI7GyXnnPDw6HjVDFwalbwabhbJXoTACK3xBO\nRFnUWsrpSxC0ltfbW7pWnnbfJ8aDSCyc9okh/2EkYYgJpwW1LRPAXfMLMpYs\n+Uuz2b9GUiRfPEoSmNenxShbxvt6HknZiGPocHDB0KKPqJmbUXued6mR+JAQ\nDPf1CGXFfLGpBfSh8T2+r1w1XnQbP6B58GQdfqKEMvOAcDzaIKPhy7VXJ+CK\nffe4nEquTjL3JU6b2fxsxnu0gACL1ZCwArexPOIyL+0tNu3KLmuExqveDIFf\nLEbpWYhej/3QDV7URIqW0cPyIcwCnXn0cdUv+I2teKZ9vE5SSozUD5aft2he\nvOkm\r\n=ED64\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"865ce4df79a68d5f8959e013a0ecb037b02c4d8d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.754"},"peerDependencies":{"piral-core":"^0.8.0 || ^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.754_1574751661746_0.7890382623399388","host":"s3://npm-registry-packages"}},"0.9.0-pre.755":{"name":"piral-pwa","version":"0.9.0-pre.755","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.755","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"076a4bec8af9eaa1566050023c583aafef84df29","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.755.tgz","fileCount":20,"integrity":"sha512-VsSz3IM4je/GoROA1dUbpJyWvRrxaezZ2MZ4TtXs5lQtUeRwxZwJuPgSfvCutYEe1OPr2pdFgLmZvUe0xoiH0Q==","signatures":[{"sig":"MEQCIE0ptgbq2R/61+Fy0ixiqWkpfaRq+9uuYHO+T55THRVRAiBzXYkNFslGRhrAuYJA0Jf6/TCEDA14bxwFESIOvZT3pA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3TekCRA9TVsSAnZWagAAEQ8QAJx32fLsjamj4qtnEo/L\nYplGx2WL7aXSh0VFL5aU2k2mzVUvD0RB/gPQ/F7TajIgqyNik9vxRhVyUvrN\n9MCrOTJVtEkYEWSHqXaQxOHAtxhRVu8L1kQbv9uTOQ7ZDnQLBTl2f8O7+JVg\n9pX/KPJ4l09Maseo1iTYoB2IIFIDfSHbHMVwpVOIGbhxyNPG0/PxRpnVwlVa\nWrX9Z6qaB/dMH/LkvshwJ+PmXXCXYw9G0+oYuRhrWLnYYzfKIyiQEYGPf2yL\nSPLjgGhMvXq8NrrWnzZv96CTaPa+pSz3kqXHulmEORu0S9OxfGqPs0O4ygDA\nojDrPCcJrxOhcP1soB4BcrKXoS6CY1u3D4HQipgFFoislw+ik0y45AxzKgj9\nfeB1lNeoJkdhq9migZFSbcQFdx7GLZJi0zfyBu88WFjryj0dABdXjAgSmzQC\nxPQ7JHlafPGYsfTwHeUG1py/3EzednJdwu9imLRwRHd7c62g7hhe0c7jmOVi\n1l2XtlsKZB1kzhqOXoUHh+8ssD59KM7g+0pcXDC2UsKbflRBLFNJuU0p8UfY\nblw+IX/C4PzIUMsGT7v4D6YqS4ycpUxfqwopPd8TpPQvP+Sz96YZ+8YlFIZs\nD6K/vQlwuuPb/pkQ7owrQ+l7uPAVvX/2yq/eod8aPjHc1bE6Hn8WwV7QQjk0\nTpk/\r\n=moeZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d9a89026e93ddb2eec63195a98f0a40ec64400cc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.755"},"peerDependencies":{"piral-core":"^0.8.0 || ^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.755_1574778788342_0.9768999815347152","host":"s3://npm-registry-packages"}},"0.9.0-pre.756":{"name":"piral-pwa","version":"0.9.0-pre.756","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.756","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9a03842ab4559a8830d604bb06a95f5c1d472598","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.756.tgz","fileCount":20,"integrity":"sha512-hnf7vJwJV8ElKIL9b+G1fyXmTYOlyIx0xUQx5tufeJx5fm0nabQjslqb9FSMfRCWXSjUU+tlKH7jKL9enhSFPQ==","signatures":[{"sig":"MEUCIQD2csxX02XNHRCGh29fhCA9wvcMtzd9A4MJeZB96CQ6pgIgFYs9PTmqU2lulB///srB14jFem1QmiA2nNP+FaLZaw0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3VTWCRA9TVsSAnZWagAA1T8P/R1jMzG6WBIj/9FAHZmo\noxfE0zzNy7cmEbylqgJRHgnMH/DodY92cvYmIH3k3ABnLR2hpeTne7Qxsspq\nm96xfeZXPw+zqOIsLItkkxHdURWexBg4XMWEp/pHEZFtt/Dphzwr3kk5BrBd\nP868piwBJQVeBT4HkH2aQTfhC4pvznoNCVnOFralCccGFUV0bcHqus7pkHrP\n1jT4dwbNHCJLTypS2UOBJBx9lvtD4RdWYLzMGlrFbgUTItKLRZo5u0vg868b\nZ+JBQoO1TAZEWEg6Obrpp38TaLNFFaC6+tVSSwSS3oYN8CMjA/Gy2H6yXgRE\nZK9Nx+FF5A0AzNsVOOy0FUk5TJ7BKkwB2Dxeg98Jir61G75w6RsNT1iGXYk/\nTvXGcpfnyOTN9V1Ex8BfnXGp5FR4fGqdzjK0ui/n5n1KNEkKaEXCWiNZoofo\nQPIlU2BRv45fRR9GGKbDWV+rpdvwjjv35nTIPiQIXKKREINqUYp0vB4vamWE\nuYAgi7v6D0INjiiYkH0cwwq0cPJEZTuJUxi878P4L6qGaBJIYmh11YHE13TQ\n5Qzk2degkvogi5nVCqf/r+scqsB/g322pO88cyvfzm4qjIDdr52t1oMHoCqt\nxzfoUk8YLxSfiJZIDqbBYh33q+66n09jio64w+KJgvbgtncZF64vYsYiGCJX\nj6OE\r\n=XuiN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"412a395210f272c7245d8e186970dbb129dc8cd3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.756"},"peerDependencies":{"piral-core":"^0.8.0 || ^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.756_1574786262518_0.9283956692682942","host":"s3://npm-registry-packages"}},"0.9.0-pre.757":{"name":"piral-pwa","version":"0.9.0-pre.757","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.757","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"27d3f214f8ecd9f1af6d27465524f8d99cea2d1c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.757.tgz","fileCount":21,"integrity":"sha512-NlJkUcE7VwiFjgSOmfJFjcX6qMtjTUY9KfeSU5fHlKhj7hTAnJ+gJC+I0EOI+a5npL/Y4UbBbWm/wqbqsEVVjA==","signatures":[{"sig":"MEUCIQDuKsdu+dr5g2IUDKS+4SH3z4eI2HN/Zc4JVBCGV83GigIgLkVA70+3/mHuGYcKokxvTEvkClAA7fgWjAAdZkOuKRQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd36gTCRA9TVsSAnZWagAA4+0P/A4qa/9kLb0uHpltXLk0\nBmg+lKpBb1GH6eknXJFqxXXlspBacPFgHYECY7lEhmbb7N0EbAP0S/ig5HFg\n2R2NY4CakB+gQc/ugFW0PiVacTKAj9PjOVQmyk/I7oqQtXyUIX2xqkR768pU\nExkIzMogmazYDErbS2MovLgiEkHjLX+fM3CqFPqqtUDrmjl2s4qKnELbVdDm\nsrd2uuw1ImuaqeGoV1+OnFSW1BMFe0qx4aSo0PJ4G4g/+LZHOWkNjCg/BguL\nBnWnbyTNTlRHe1W9gnLQB4MJ0IHq5On2ytYZnkIXxekrz9YTQrEw2DwKPIJD\n5GjRMaj835Ttm3Dg7H0MTodC8+rUKn//K4yBJn8L/jMiDzEi2TB/JIsvUATb\norl7Y0FYsnM532fQC4pdWeBxtvPDVwHoMnwECJhUzTIbKEoXrxH0syPqsq2n\nmiQXkLiAUovvLdK+/CbNH0Lp6CDVU6sV2jgK526KfYWIrEI1RAC7FF4sa+h3\njSGC1udComD0cg5SXzg4PowQKNVgfHuFz1U5/0bSEEajDj0KQUyNbSvLjDU6\n5bVdLHFUpX/v4NFAhjBr6YY0GZIYgNZ3RDHwZW5A8mRc/ISihilSgCC1JhZC\nSN26iuTzpnqWCWxdMe1kMvl+4X4Ofty22caiOpA4cLj3aFF1T4iil3FY2FER\nWdjH\r\n=lmyY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5a508f91c2f538c7be04b4052e13b272bc481fb9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.757"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.757_1574938643011_0.5835266509679693","host":"s3://npm-registry-packages"}},"0.9.0-pre.758":{"name":"piral-pwa","version":"0.9.0-pre.758","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.758","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"95b0107f6966fd1d957a13e19721cb774ec39107","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.758.tgz","fileCount":21,"integrity":"sha512-HPX6oJCvWbWN+YvfnnSO5g7DC1Phr+sF+J0M+i4OgJun/ZIQmILMqIRDdA1hEsJmmVi3FnKcEFCmWRjJhQ+yNQ==","signatures":[{"sig":"MEYCIQDKkzGzdijLeVtJFuVZWcvo4UoZmJwS0jBOjo0UQUrTyQIhAKSlu/T+v9Y2qwSolYernUZ7BxBM8DJEfQvn0/oIVMRZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd4GchCRA9TVsSAnZWagAAPYoP/2IOnTXNYZnS6aej4Bfe\neFWKUVVMHIGV9vyS98sVnupAMvB3BXqfXKLuBEkqPD+atkop3mXC4dTDBh6f\nZMjZyyl9OorcnA9+20tj8EsUXnVDlRBjkFBtivVtPSX/XSStSjvQo33a/H66\nr1rMrmKXibElAVCbJELuUMqueuG1Kxkjd6CJy/2ViJf1x4uOisK45mshemN+\n/Vg+WAksfhknu9dogbxpKq+qN7UHj+QtSNdxq3xHz/r8vZyBur6yomuXsVRa\nv1LPDjo79SL8uyJm1M3knmUfmDNwzWF9SpWZrHfrvkFvt0H5OgxvRb52XxxN\nuZWlMKRXOzrO578XK2a0TFz4D8h4XvT6QMBj2hYYXUKWPzdavBWkXDXfBbKq\nRAUkX6cw8e9khVduD7t/jTAVabTsd4edi+rF2qRW0nEEbS5mHtLu8oVGRJhf\njDq7qp9Q7mgmsbO11+YZoJYvOIsLFi98dR4gXtBsNBQTre4Qq92XPtZfUF5H\n3jpCBAgdXu0o2QvbGlmcsQARwhW78sqEVraH4OnbQgsB5WNC3aO5j3U3DMdT\nA9PHdba3SnRHW0HhybbOQ2s9eY3Nqku40mweHDDLNd/fUQNv8NUGQfowhAlo\niSh+PRk7yDbQRc55ykVkCTPe4z0YdGDC6FKaHoDR1UQh8iwm1t/otpEREmi/\nRsYh\r\n=+O/A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b55b47bf72b559ee4dc3bfa0012252e59eff3161","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.758"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.758_1574987553413_0.40369369530832877","host":"s3://npm-registry-packages"}},"0.9.0-pre.759":{"name":"piral-pwa","version":"0.9.0-pre.759","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.759","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cb8ef4f4859e62d48915d7af7b71cf7572c23e9c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.759.tgz","fileCount":26,"integrity":"sha512-8I4iE7gO8B4sBu79Zg26zERO8K0vZJ+KRjf/mabXjmxEF9qPqTu7ZBK57tgBlg88+TlPiJ2OrNGUjGiGVYaLTA==","signatures":[{"sig":"MEUCIQDTa9HUaI3IQFl91OT0GSBHHmvOkcaP9afX+NpfFH7mtwIgO9tyLKB9D5E4FWxujUY4cQYZWe4CGJ/9kmCteiz2eac=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd4SayCRA9TVsSAnZWagAAJM4P/1U06a6L6JwwegG/dUCa\ntCfDibTVYvTopTww2ALz7PSe4As/5T98D2nOhIF1RDTwRpX0d8piuNye9+kH\ndvxXUOa93MELSe8hSamtch5FqrU/YqDKbh3d8ftTVHP4IQce7S+gm+xNTWdF\nQb1qY7H6OVx/BQUJsw85+b7QaIO5gRk9AIt1JmgFbfuZIFCd3RHhPMjHl/TV\nhUv5F4dB907WUtsi2qFEMJomjg3rPTnboEKbR0ZrbmKESkrF6cnTEgTtZsK9\n5hZp1Hw8wNfuweCEsPQEzDrNIQydFMzHhKLLcdmBbvctOq7D/mGrRrFuo6av\nEGc2VXeHCWIixc/nV3QbmxiHZmCC0MlCPVqLpZnp3Sj5Sjr/8B/uA176GYzv\ntwWeg5bKAd9Znt8QZKGW3KguIrwHG3D1jquDzooFUZJP8RDEQsE8Tx6yhkUQ\n8Dqcu904PvSoHRRoeQTunLS2OtioWfGxRvokGV4PYlsHmvwW1D6WAUYt6Uh4\nYR97R+m4IOVRVqCTbE2Hllnjn71toTxyRx/HJKa5EhSunYtCDue9OsoH+VuN\nYyXU1NaIpwEOgtk/Bbh+G8i4yKRUq160u2lMDfYMoKBT7fUdrJH5/GACR4ea\nLiuowPQdYckLg9M1oHypLS9IXN2APLLXRoMgM3jg2PrJFYNU4GYmVsO0AQTB\nyWMh\r\n=6Vwj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n(tbd)\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7f99fea46690df403c1090aa68b81a29bb5b83aa","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.759"},"peerDependencies":{"piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.759_1575036594267_0.09823340273007442","host":"s3://npm-registry-packages"}},"0.9.0-pre.763":{"name":"piral-pwa","version":"0.9.0-pre.763","keywords":["piral","pilet-api","smapiot","portal","modules","api","extension","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.763","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7cd5a4652257861dfc2e7b2dca8e328bcbdd1f1a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.763.tgz","fileCount":26,"integrity":"sha512-hc+cUmJMimSBQeb+5iqd/6uFrCThQRytzlaaWXXarHAMPm1NDbn1KRcPdT9cfCSWx+HyxpiBo1ATmBW1Ny3/lw==","signatures":[{"sig":"MEUCICagah4GjoDSo+KwoD2sghGgy0GnrKJSUB81qDxNv8GQAiEAkjlWhOOmDlVXtUur+H95IF0io09KK+Vwrwh9IiTubOM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5T4ZCRA9TVsSAnZWagAAP/8P/1Tevyf7exLM6guhPuO1\n67Jb4KRDrg6L3VrJPvixn7IFmnrTtfpZdVXZxvl2aa2i6JH7Q95z/8kSDpD7\n5NI7Oeh54fvVUBfWGeC8xRpjLprFosHq9Iv2kxiy1KVbvBsEIlYr8ZjiO+lG\nK/Omda0dqUXdd61OfTk/vuljWeV3WcFgmjsbQqJflmdoojNg5FUYsxLg26zA\nCmLvhLr6XOUskUwArP1qAKEksuyyNQCfa8nN+9gep8ZCaMa92ui6nolz0Lzt\nzLsuApqg0iGlGoQjmx/3ukX1cCjzT4qWJit147r7KhWkFDnXoMG3KQXrsVGR\n2YQTgqAVt1VvPikakleMotzina9un2D1elzyVrSQ6cwfZ1IO4GJ7pljXDkB4\nSIBhv2mIxW/GzF9uhdYpD3acMpRKEqwwUWHI70IMs9fktpZODqCmq3zlMtQr\nHQoPMPNygRB/qLz+ZNVUpV6w15v+rLU7WpCNVqzDC+VlvQpeTEkqeQcAHgiO\nIVC4Fk/5GgSjmW2krVPtWZ40xv7XaOeuX1/36TZgn8UEkx9ZdWlqWE6nOlRS\nP2LZncALkndSyZKhUKjrTvztd1OKE/fnVzbZTkemWObzW9cbnks8pXw7n5d3\neLwiQlbAGLgzDjmqIIt3MgVQQ+bV4zzYl4eiRwivCWcHGMTz9qiiw2JidStQ\njP8+\r\n=9BIr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is an extension library that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\nThe `showAppNotification` API allows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOSX a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"244d493ecf0c7986e549b0ee2fe48feb20c52cd9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Extensions for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.763"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.763_1575304728897_0.3730436760659894","host":"s3://npm-registry-packages"}},"0.9.0-pre.765":{"name":"piral-pwa","version":"0.9.0-pre.765","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.765","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b1c43745bba495ba9039ed21c7a8b64237cb68fd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.765.tgz","fileCount":26,"integrity":"sha512-XaV3hWvM4stSRiMMwaEPPD6p/62p2/T2BCIava+Qq2ymD5Kdj8M3CWBrlqWSLvTyYPMgxed8puPka8hXpJub7g==","signatures":[{"sig":"MEYCIQCw7UVjl1oLLqyTe1iieZoDcJ9FRabXK0q47V6TPSnrsAIhAP+Kkn+2305EF65yXnwKHwgm8qgvzMvvf7tCfDuWquhK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5j3YCRA9TVsSAnZWagAACd8QAJJRbsU0folEqgDYhcIG\nRc5JQ5Yp7AOn3VZ0lUf+gnyDDoi1wWbBXivKnPltxgftMypR9sz2vZ/kHmK8\nHqm/LysvZ4oZYFP+5FtBrU3Ov3Rw/V7aI+grRqepoSP9zyVj1rs5CYawQJVJ\n6E9Ta+BUQDeST+fLGhJEfqdSEv8RXqBZU235+/1pGozVfuzvLsJwQuVT44PG\njFL9067OPqepN+5OYWh++zGIRpKZBMuHohqdWYw4a7AJO2WhnSHYTKgcMDfp\n9D7MuZSSdxeonLESpTg/qNiafHbvZ+J7pKZ2ih0X9cqtBQUl+HzRFEIwunuq\npa5k5GffjBQk9cUo9X9cbTfIJEcsmP6qiYsMYJdCMn7HZL+Un17617Y8zyXH\nQ162Vqe7QNIlWczf3m9eU5DMcxb/8HnG5Lc5JDXU79KkCUxTw54KiicGRWzV\nsIgzK2gNezriLh3SxxzSKV27a3pWcs0OrqFbOtlod+/EEp3HG+dToYOkEiou\nddAYtxndbK50NT+8chI+bht5+Nhoq92KHhhiqTPEevFkM1P2Dj9vzfQzjYL/\nP0pCsbTpBvpv67Bs4MgYM7FhTnIGLWgv9HIAUtBAJ2NDN6aVjdYWIy0hyBTl\nfEiikYr494xnIasYpuCNAGP7c5RzqCNEt9d3a/VO44J2FdvPfcooIQX4wf4W\ntUTI\r\n=IVRQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"81e14b202558d9c3bcf2f8bfdf0b758d0b4b1043","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.765"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.765_1575370200151_0.958715214401572","host":"s3://npm-registry-packages"}},"0.9.0-pre.767":{"name":"piral-pwa","version":"0.9.0-pre.767","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.767","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3a38ee882b30b31f9ca09e2fe73e53517cf135eb","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.767.tgz","fileCount":26,"integrity":"sha512-E8kbcKAS0IM2ywYa/pqqLPPnka056RzdsWiH1v+l7ZHBCxAy3dVZEru5W9SUnSuRHr3Je4ekW1wY7ArjFnQPPw==","signatures":[{"sig":"MEUCIAvqJ+OpB3iVKaboxOfCXC86KGexXgBaRIJhGqnYhfqbAiEAwidfzfb2kljhtJWFmkrq9OMHyES3Vf2Zzs/mUgCGhIk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5mwMCRA9TVsSAnZWagAAK9cQAI1pwmodUACiaa/xq5zQ\nBPq4OxHyQJbdgGF4/JhZenWeoFaj0EKvYXZP3YSOXe6scL2Rp1oW6WW43eOo\n+rxztscIGFlb7KMgdDxO6zRsFtKiMYiLC5CW+gPm50pPtZp9nTL1E4AJ06tV\n3EKtYkQC4juN+LWQJa5aC8UT4btbR4xZ0OsVuozs+LoxbxYwfSQsUCx3h2wM\n5qs+xjMfmCZ2MDKnLbo5KSLnM/ecEAql/Lyny8lkd5ZZMNaX8l/jbv3FPO29\nCjlwlAXtg/UujU7iorernWZjqN1S1+taWIo3uI8qDOnhWADBtvOdv7j0se/b\n8AMCyOLFDx0UhyZhwpRP75idxcUrxo14UPJqQAIolMlbJ66GOfGXB9JGbf2i\nPsVYEJvLTdpH4gM2k8U9CVYVf2f0VYeEWcEMzKA6JDHc08XWGl69jbfzcn76\n9EWrkvFJmtG6GPo4YxUecZ2rGKucTE7Ksw1WtGgqPdE0BwaCm+1NoJfd3Szs\n3r8+lNtANHbOPlr7LTzA2sU4W8uN6UKv9IgGgFYJjAxXVGsuLsMQ2WLVtmFb\nM/gqnX/OYeLHNwHe8ef4QRngcGuPQZbChbGm6CFdGGHVBT3J406ZB3B/WCC2\njk7CTH/MK7Sd2if6hqPyt+TOR3GDYM2a9FzGWT6JmFHHoMjXRcM1Bzh1qckV\ndTpg\r\n=9h5t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"6c850918cd58a646829f056813dff3bccaba125a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.767"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.767_1575382028328_0.48327097621224446","host":"s3://npm-registry-packages"}},"0.9.0-pre.770":{"name":"piral-pwa","version":"0.9.0-pre.770","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0-pre.770","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1fdc0f667cb0bb03d6ab11cb45059a9c893ed3d5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0-pre.770.tgz","fileCount":26,"integrity":"sha512-wuQCVw++MWC+X4MiHq+i2euRooJn3csFSCSPRY4xgr3VpQ8lCo6aLSsqwsroPh10SWOtQOLGDJKnNczToBj39Q==","signatures":[{"sig":"MEUCIEjHXHDvWf5N3rv1Vg79CYikCoVCoklGaVzgngmMiyOwAiEA0bYKd2bJcazyf9htGpMrkwKgKJdqqD4zMmR8tZ/ucyc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5nkSCRA9TVsSAnZWagAAJe0P/1goyKeCUPxuLbY+aH+H\nAqXO+Hgz7sQED0p3rqnPJRKNGxcE7Uw+qql2Scox6d8eg2kXM9Ykl/J2hWVs\niHB2jpDywwzhNvXz/GdIZJ3St46NtHZ/JDzFPGfvKxahNMbAXxkHOOd+hHAg\ncjO+QptcpUhgAP5SUU+amEoxI6e4ZBl8i8PWFA4PXKK+JugMGsKRTGyxSli/\nw+sRXfFbv1vmYn/0nEwWhc3S4SUhl6Sy3Gl44IHfqwtLvX5j28oqOZFsYEoE\n5YbaKNvYurkx1z78a/dUtSInN1RN8FnTh4szckuYsW/BHDvwlcAXY6/Xoacc\nagoeqsnSSBeXXeqkhllgavSZytCOas7Xgixrhr7RvXr8XOkzkH/B4zRlo1JP\nmvHU8ZgpU69JlMv3sfTD7z3cT2Zc7HXc9MF/n5n52XuS3UPER7MDNXNo/ZDT\nc+RolFoOHt23L4hUy2eadlRjMLQ6e2DzTwtFAAQvkjz4691xRsdk3s0M+V2K\ncRTom7pCuel23T5XFLL0D+Ede6IUPAuS5rV37rfEndSbe7osvB7TibT1Gre+\nPVKS73oTqg3PGHpX/pSy2CnHC41F6ZmVSLbtdg5bxbWC4MAvkZIZxyK2WLoj\nzeUMwdBjuPggzLObThloTkOOSrzvkRpp71JSnqA1v/gF1oLtifFEiVMUUPl0\nvBlf\r\n=B8R4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a9d4f01638bda4e99ac9b9328dcfd681ac8c2b3b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.0-pre.770"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0-pre.770_1575385361701_0.4259944572470544","host":"s3://npm-registry-packages"}},"0.9.0":{"name":"piral-pwa","version":"0.9.0","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bf5496ae1e198b3da899b7d63f8a396047c58a8b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.0.tgz","fileCount":26,"integrity":"sha512-fPx2leSsBewKFzpq2nVlWUZMDsMOPmjhv5OCVS8HEYcFzJdfLqY0Q0Svaak/Or3lpDcyPIPrsumZGXSTmKXc3w==","signatures":[{"sig":"MEUCIQDAbNn9vapuhNMz80o8Nbvn7RqsioOuRhEhxPy/WQ1tqwIgGLv+2Io9sX94AKKQJZyaTASBVPMnFJV76eMfk/IhbH8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5ofHCRA9TVsSAnZWagAAZRYP/jFkeoA/p+E+B+9sN93o\nVRV0zZpPGHP7EgV9TSGkFVvxEyfIAD7GmGnNMJtYdIvn6H/vcmwgzBYDTjrF\nzMh1si8Yn5izl3zy354dStxCC976JZ6UZjAU/ds+VHgLIJfyz2cwzoU8Fxve\nWt0NtZ0nKohdaIbZxq0HDcs+zKuoCUwL8WG1NNNR0IGFgq16IBF0Ep3q6ixG\nvP2On0meQDP/If259YUMHHMlLTD5jiq7ArDhu3C7EMsQQgjB8HGTLSjtQm2c\nAqcDnjm8sWvPzfEGfqqV9RSV1OqKeRk2HcC19I7S93eeMdNzJuYWOgLzOJoG\n5DYVEPQBC/RiP3ab+kDgr4y71K30rZHGnCCx/uL6iCto93s6nf97KAAb2k/0\n+VwF7Rg1EyFfbC8g1zipZ1ZOLaFJ87f12NRzdQ8da2vSJruYzGpiRGRmuBQq\npdjjEXz/MOR+hUV2Ar/8bOcvexq0a4lgDwAVyBphoZ9HATF/B7LqCIj3LSiW\nK4MCbQVt1W5ld1E0gK5HuE2RV1yNY/uM3mj8mRXHmFHajxH1yte9rGhDIJ7G\nPDzBvD7s1lO8hnwbNN91zmxXJsMVmwQxULRNbhS2aaiZapMCTKohsGa+okIm\nHO1Hvd9rbsg9UDJmbAVcIC9LNCGjiQmJ6o8cYO4jRN+pJVy3/h+ah4V6Zqsi\nIfUw\r\n=X4YJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"7ad4b45a83f6f747feee198853377897ce5111b5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.0"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.0_1575389127600_0.8170487875715517","host":"s3://npm-registry-packages"}},"0.9.1-pre.779":{"name":"piral-pwa","version":"0.9.1-pre.779","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.1-pre.779","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6eaef3c47c1c36c1a8d7ff854417686aa4211f64","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.1-pre.779.tgz","fileCount":26,"integrity":"sha512-AhsVh4VN6yEC2d9AV/K1eBNolJD6vrrNDBeRdus+ejQF3SzhRdXWOKpFd0sbAccLXE8N5sS5utyBE0kqE0EuCg==","signatures":[{"sig":"MEUCIBkL+4wjxx0GlTWEU/aRrLj7PYqsyRyOWlAbn1Rt+8iRAiEAyJnDxhuczZEGmCzuCPTuJiB60ex3J7+WpTLbXOSfD/U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6O7XCRA9TVsSAnZWagAAz9wQAKKjhesZut41p+xWYqI8\nrSHOTWjZpDw1yq24PoSAjuJ92CEay/6sq5Xg7W3GDfNIlVG3MDIWbiQyCL65\nz4BOY3WuP47B4pQAyj2mL+fzfAOHg9hBGmbh9yMv+xSL7OYNLPa5lbGt7pQb\nF4U/nIilnTdwOIC15PU0PT/FUz6GVfsqZWYIj/3t6jhdkuJY+B17GRdJwG0l\nY3nvxPo/W0penZrqHAPX6x9q5+esukKULtkKwHl4au0h6Dv1UFQn/+H/LoJ6\niQrOx4YGwS1jj4S4jE3lxzd+m2fOpxJhmlWvkFT+v4D69LjdCe+fnJXAxKoL\n6nrqeu6Koo1B5GEy4aMEi72M2pTNKM8D8P1elyem30rXLZsE7zWlEk8CEjL+\nS/59lw2/tSQVw6ISZ9Frjd8F+QzZG16ICl3/YlK8ZQDYl92mVIhckRvM1Afe\nygVDAdjIoaMHztAhW7gQgam6y7tEDFObkngivh4+QaWb6kBSZ0IGUi4yhty2\nnRWUEQD+pRuBDUMOO3FCFlBcZXtNkDApHOTuVXnh0f4DG0Q2MgsxLHyhoBqd\nWhhiPeJqtQySD0HyKgC0vJZGLxBRe83u7n6rrK3Oq/7xpPImDvKEBMIGVaqQ\nZwYjA3wa6k79rgDHz1hW+pCFScoUggXXt/3mzELH8oPKBdDKYhd8M1c+8IrC\nT3fc\r\n=s+RB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8d4e44dfc80a4b8c33a7a1c5b3426556499a7aaa","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.1-pre.779"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.1-pre.779_1575546583227_0.6932972580617351","host":"s3://npm-registry-packages"}},"0.9.1-pre.781":{"name":"piral-pwa","version":"0.9.1-pre.781","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.1-pre.781","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4d511eb89eb61fb74d484987c45b7884dc1ef867","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.1-pre.781.tgz","fileCount":26,"integrity":"sha512-Sn9eM+mCGLAeXfTcT4V/0AxnU3kE2+PWlc02HeEtgFuqkdV5Jk2bC/VHftfiZJJATWRo2gtG6C78Qzt7KaH1lQ==","signatures":[{"sig":"MEQCIHyKN1tcaBgWgSOJAwQLTUAyPTyMzNzGxkMX+fj1A8nQAiA52bumG+6uarIn0EOtED0rDLGefnoLyBm4kcRAtBeTVw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6krNCRA9TVsSAnZWagAAlI0P/0z6c1FuvzIZXgLDVmEO\nyHScfzgx6Fz+I1o7bTRjISJMC3uKn67+mInZLTn00zvFpqGIMnyz5a2CKw/L\n8RDVk/qYZP8CkVh2GgxZZIObRekvqoX5bqnCV7BCEsT4v/7np6KsY74ddkzU\nnUq/2ONHXFqe4+yu/sAvbJevPoR632rOAwMiRZDvDQUs3jYAiGTXBENxOt07\nocmyYZef/6e/XPgYrLtJTkluYfh2XY+XRO0QAcfZgPFH9WZDl2R3jHDTJh13\nPNmL1/zsGrP92OCTk0owd1OVs51yqYUF9hKRR2HCd8SF4swA6V+DlhHj2AdH\nMyBuiTGBNXLsSxVLSJvJF+YrSTR7her0XyPhS8nVwV3MTCcTZAlldy5fEXCY\nCt/fMdlz7gbwpkugn7etAA1g4z0hk/jPue/xIHYYW/JG9yH6kJLvLc0dkCAb\nBNpJ2f0bWJmv5elLoG8ez4RDTACFyvjlcIT9xIWb3xlelI1rgEpCQqeSYYJA\nS2f7UgVBlDlJfCclLdaoGLdFhswCuEBsq0S6wkbLTZuiMOL9Uf3mEqcATRFr\nDtlr9zVEE5qWF90TSYxBRA62PrreDAaEZDUhXSlPA3sVuw5cMT/3xoWf5jBp\nWnHxkMFaiz4YQrhSR6XSAByex/p8yPDJErU+ukpqCg1Jzi5S/9Oke8oGczTo\nk+rU\r\n=roM+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f51ad35e2e03757ed03872514a31c256cb8ca353","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.1-pre.781"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.1-pre.781_1575635660948_0.41917661816094265","host":"s3://npm-registry-packages"}},"0.9.1":{"name":"piral-pwa","version":"0.9.1","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d65b10ccbe73cb08b79ce361d767cb79d0bc3e3f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.1.tgz","fileCount":26,"integrity":"sha512-gOwecqrsiXMJUIMMKhMQvEQBWMTy2MQjcO9tsAPwIWIxDaNRYaV1JVGCQLWJMp1TvJRBa2PzkIQFBWaG8LyQZw==","signatures":[{"sig":"MEUCIGl9kscW1K5GM/B8CbFWTIwdTjsF6fHKQl42irjbSOsUAiEAlAHadGYHqct+cM3c/BtKey7FvARu8aBCBfnXMsT4tD8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6lk/CRA9TVsSAnZWagAA64MQAKClN1w7+7TMPUZfBEhN\nUZLmXyHISYXfdWzRE5cM1q+adH2OiYYJBnbERVSA4RK7P53bQoolE3QL6Lcj\nLY3oMeKoaBJDfb9xRZCH+WWn1OoF8LmGu5wIAXEXRBNUYO4vxfyPDiRkh53w\nf9nS3NMkB/n3AaWZPGvYu3Ui86YYlZV0wt2Hm0qi9JIAQrD0alV3JofDoVBt\nHHu9Oqr2ECNpOzbTefyJtc9ZTvSnX8/raojEjXTuKYml+13DXEaASOe9TS9g\nbfzHMemvzXDeTPIqqmAUSzs4rWIStctZLrkaMPHW6ZEGdnfTeopTL+kfhnll\nbvsFfLnLNKg0IcMhEdCrFyFkGkFSd+BpsxvvREqVtMWXHoa46a8987Jl9wZ9\nirVB9ZrFhvf0hlKS8cxaXIV6JPUic+nuL7vV6po2kg0010dbCxXrkkMgg8Vx\ng+fwF9ZWKpTyBXnQe9CBCJoEtYl10OsxG6RCA2jOPIDTnsCX5IpQvPr2oxU/\nNSK2WEiRI3Jw2T+gPeJcv6QT8WmIo1HzylNqZboSaUu0fxsSHVuyx+tMPOWO\naLgJ7xSPGrDiQnxPxROz4jN3r5P9WpHkFYo0nuC3Qrev3fhduH39N3z1ACBT\nLknoOz6tAkMm4MJhVKrd13EEKA/8CKwCXR3aJXW13HUBlIDzKpgvjogvJU5P\nWF+3\r\n=JuRo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"9103c40ba8d06f7413640c653152d0c7996aef58","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.1"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.1_1575639358947_0.18156901733285657","host":"s3://npm-registry-packages"}},"0.9.2-pre.785":{"name":"piral-pwa","version":"0.9.2-pre.785","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.2-pre.785","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e68887488e73449798ad42fd45adeafdcaec2a72","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.2-pre.785.tgz","fileCount":26,"integrity":"sha512-ppzONJXPLrnIjwF/NM2fY94ud2PJa/SmrzYpiCCdQdyKfP51TwZrAQSkrvGsPNC8b2u15S4Do9thAMOoXQVRew==","signatures":[{"sig":"MEUCIQDiKukFIRZInG/rF28PK5bnJHlCcYluoQ07VD7JKrTWuAIge6NYxkA03hVDGQ+XJt5PZTNjG/HQ58TMN77GqXu29FQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6tDqCRA9TVsSAnZWagAARL8QAI+og2mp5MCRhCbO/Ypu\n49AdQGPsVDgVpSd5DUGNc2qx1JdSoOcSbMFvNj12YtdBJLQqow53GDDcFakX\nOSv3IBr+Hw5y628OyY3WNUifRaeM3YqmvrwsnJfwv9dHUd9G/Cm7D/H5R+or\ncIFnSutB5oSGQ2CWjiuUYdviAbU700MNEo6XP8sMG3+NKaYOi8v4vyobAjKs\nzTjDLpe4Pmkaqr9+5/1wd7IzJ5nHgVPtY8xAgnIwe7R/U/8CzKMLzhGBQHRE\nKR2ums1w/GXV/KqklJ96/XBACJtSNCPPfwYFzy8Y6bDXonTuAFvUy+e2c6vz\nXsdEz84f1VtRloBdojguNBl3g8Zk+9vh0/uPuuyuK35BIAh8iL0V/aUmiFNa\nHXp104MtDPZu+Pq1l/1LLoAXHvRBeeKfxLSFgQu3i2THQgP4TiRHVOyWLggw\nroMwczxYRYnv0T+STrNKGi55/mf1o6JyijgIp2e1LJMbVEupOVwYhpafWuja\nAi4GTwoyuw+ABhOVYhQeI3+Qt1b78wI2T3u5RR3wl1zoyhRpVNhRfHSl5nYV\nXlyrbhHdw0kvEBlFD2LmrEDem5fngVbNsWoiFnH4Gi/m31ffCZTVPlIUUjEn\njtj/pndhC5d4cUyFtGPphesQxgHIb4QsFE/yL6c1ZLEWBm2pksPNrEXIhZ3C\nv46P\r\n=vReP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"eb5c1159fb61fdc71bbea42469457f91fc08b1a5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.785"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.2-pre.785_1575669994206_0.8546712623646171","host":"s3://npm-registry-packages"}},"0.9.2-pre.787":{"name":"piral-pwa","version":"0.9.2-pre.787","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.2-pre.787","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"19069a45299344a010ee50207ef9316eee57928c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.2-pre.787.tgz","fileCount":26,"integrity":"sha512-VT+fI0L+FRoYoa+PRd9k7nYEY1A7IxnPJ6fcY4n9UbhY5Yt57rynt3NezBIczjS9mwCFpDG/Tfva+qhYNigQuQ==","signatures":[{"sig":"MEQCIFvQMknoPmKeqfV21QLWjNfYJYaKyUCk9g3UfBQh0CrfAiAXRXA7lJHTKSt00Ubwh041G+6uBycHGLS1qbjoCLs57A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6vBgCRA9TVsSAnZWagAAE5sP/jVidGYjls1jRNNLg+Wx\ngEDEwCqPY8JnPLdPdOTeHVIEPQ8mUssRDFNwiObUaajzNu8Xv3RfchlVSnJP\nvncC8dUute0EURCEZDQr0ccnL5M6Tt6nhhdYQbXEgq5BgFgip9WOxak9nfyJ\njSP9r0FX0ECL0OHeIpVF7RHEnQf9PG1nvH4XtwVsq6fuylL80KsaSbTbi5+w\nbq0pKXAYn+fvXPhO97X7WsWI54EIKA9n2rz+DE+whja7jBkJRcNyS+jb0RBc\nNIJzu0Qe+G2wmFLx5SW3w6Sp9Q+2CFJkl5gwVBTSRp2tuFnuMPFzSEfNu58s\n7i/3dGF6HWkR4ugwUoYZDWt3dY8E/Dz1FCkGG7hBpkVV6P/EOK/f28+Hzmal\nlUMohbobX8OyW1598RoxTa+J2sb+KrLvZecvOE0nUxFuXAZkZfOjLnvMUdJx\nm5pZu5kkNZo5zfZCCeoazZOjJImS0ZEkzzXzAHHRxeu5Krh1Pq7tYhBGWAso\nBwckToJYYN8CoOhVowYh6x4ofwCJmujo1vk1WqdaWy4FkWWKCgLHRYYcL6ih\nc/EhaJeqQtT5dMPvIbUatehH4HZYU1je/Ssn/XI5tqCXC3jqhhfq0lMlv57Q\nqNZXPHyjHw44ref6pntQjnx4SsyDqq3D4hSn1rcHK81pD/onwaJjwrkIUmcB\ntTqC\r\n=DcGE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"819b12f2defc6cf87e2e2912ea2ab45a1091bdd7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.787"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.2-pre.787_1575678047908_0.22479117042702135","host":"s3://npm-registry-packages"}},"0.9.2-pre.789":{"name":"piral-pwa","version":"0.9.2-pre.789","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.2-pre.789","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8c48cd59d4d13359a877c9379333ca5fd5894000","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.2-pre.789.tgz","fileCount":26,"integrity":"sha512-Dd6piyR3UsK9e3gdkpgQhO5wkemsad34feQG1o09cQbJYewTtCkuOSsf8I8nEXfEWYEZev1lHDQCep3ivEwhtw==","signatures":[{"sig":"MEUCIHHFTel+ESfhRlvUdaju6gt7y/bOFAKC/c0EBE6ObS2PAiEA7SNqlb8g3aWpTkwNr51NABAO/v6Rflho/49zdxQWWes=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6wRoCRA9TVsSAnZWagAADkYP/jny+yAwt2ONXsv8SPOa\n/CmbT+d2KDaXOmCdaoYPcnAdvM8a5foF6LuL5JauSOZX0zG2/9gAmBA6rltO\n1sS1OaWKG91hxK0PrPz3uHA1JNysp6gBclAkOPJwhHD99xQ7pJ+jTSdTwnBN\ng7yV/78ukFGoQQNfJ68pjT/m2YAaQ4sJL9Q8WzOJmTPhZv4CwmTlDqL1Uden\neDmRMCSljwDZ4ugFkp1FjymNO8ZxL33hFWAP2Rcyh2IX0yppJm2wmOxqu0tf\n5loWoL+vm7B9kzJEDuC7leGhhFtvlbdj0c08QUWacGu1aGaxp1oQ72xMqbNe\nmaaqoAso+3O0CEeU6qG+exeXs23wn9NOQR6fbcxzCe6C3nCo+bXjUeO9252q\nZ/Y323mbLiv/yO0F5jhWsXLH23DRfO+ZH9j6YCVa7/KmsGYoZMBg1u2SOrIT\nznVqVq5/NHi5/elMF3oBn2Xl/dI8ss8kWc61MWlzwsrpp8yfIrH3zFrVnLio\nbG0oTg0+UoC5jjaX5IGvMsQhDWT8BkC7m3TJHpTsPUq1S/YhKxohsg1CqnIG\nxsEQ/nZpm/lJw86CF/6FLRzjed8IMRvwVPo+ulkxVJeOU+vZlYgwE+08t11j\n+hXo83y5yFuwc1smr5TGohdJI23YEeuFzr/A9TU8D5nJGtXHGKKCcFobanGW\nKv6T\r\n=Yx7N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e1088fd6dbefe529f0bc403454f3ca28a080358f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.789"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.2-pre.789_1575683176250_0.5730918864269798","host":"s3://npm-registry-packages"}},"0.9.2-pre.790":{"name":"piral-pwa","version":"0.9.2-pre.790","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.2-pre.790","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0d855e49f3944e73712f8dd7c219b63d8d4ab990","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.2-pre.790.tgz","fileCount":26,"integrity":"sha512-1fJOQKg33JtU/8XU4ltWgfwOjFl6pmIhm99Ppvue7JDh5mh2ptVvf2Sn/+xCXZoEyDrAXYZRYoK6Pdoucv+KXw==","signatures":[{"sig":"MEYCIQDskqmrXjaOXSnZiS+iETvyBDPFAMaPnLMY4WenRcb4SAIhALiOy8XXlF8IhDWRe2wVqNJUgY9tZG5AVMO6W7qjcCJE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd65teCRA9TVsSAnZWagAA3lwQAIM0rPKO9V2Ilv6S58VL\nsH7yK8vxy3Gtcgy4tdvZOULjB0/3/nTDmXTB5SFr2kY8/714RncbzZ/8DN65\n/8r8VsfiZbBHr09DB78apXqRQ+rtDVlL0u361kaIrsGU3R2Jwzs/sxs2rC4S\ngiskOH+ojB2Zohfm5wSygUs1DpPDKRyXgt43oqZlEBoWp2JrUkPLjct3I+GR\ngj94VDZQN1W9Atr+/1YeyXShhxQqsibfxXwuzWw+OFkc86MEus9KIYq9AuRE\npaitHY6Mqe2zSoyBBF3VHaGShf06TaYLWQP9G2qlvDNkOFVt/GbxpBFnDiZI\nspjvqWz+XOXt4T8E7TVp7TEDVrZ5oYsMVwMQQtm/0fJnPYx2IcmTKSDdJjW9\nTwZVWlp2h8Eeb3gtHPiyRSufGJoRYxEkTxvvCVQmPz+n227UYSOOBd8pqCSl\nOjP1s2/HhvHTD9G5HJQZtgTN2yndNShoW87uk2p+nb5zDtVmGL+Gg4HaRG9u\nxlVY0itEW7dDvkJlL4a5hTh2/BiGbyydjBS7uOFic8H0MSiRxYZ9+KQJ6GL6\nrinVB6bs0S4fwMzff9K8Fdn7tbxk54ZQ3UGnZZ2eq8yxeKp3kqTwWfCyTrqP\nwXa8xOHyPJQflk+YKUdcHlN0Z3nYLMz+ur/DvBORz82N5vhTKsKTiy5N970/\n96QW\r\n=WbKE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"893836bad195885ee12f34ef449167c68cb19ad4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.790"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.2-pre.790_1575721822056_0.9187155239322551","host":"s3://npm-registry-packages"}},"0.9.2-pre.796":{"name":"piral-pwa","version":"0.9.2-pre.796","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.2-pre.796","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0043d6fee4df660cd232ee2f10ccb618da760334","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.2-pre.796.tgz","fileCount":26,"integrity":"sha512-k+ZNP5Qc0walkz/AssN4zYe6E82TbLv7783nfideSYlBA2W39L5kxon/UHqEc75GOR8aFpvUaR3LcP59OE5LkA==","signatures":[{"sig":"MEYCIQCvNmVDp6N2GWzISOCnH8+TGK3BS+cJneX0OY9Yx0jM8AIhAISESVIJHPw53GjfA368p5cmG7UygV3yQXoTsgoszAwM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7apoCRA9TVsSAnZWagAA3foP/j4/Yua+bQTmiNzCxEYv\nMRbCmj+aOuyY6QoDLxlVxutYZGxHFNcn8qCLt18/jV35Yt6g6chrgeGyRwHB\nF7H9NB+uoUY8Sit8Iw43+a6uo06kXSvP5BDDN9uieKranYzzBDMU1hJ8OHzc\nRhZElS8LkjIzwpoqk/kbnyYqiQyrcxEJmrSoqe5IbDXjqd44xNWi1NaxqOgw\nMO44+ht6SyVDhbLLSEPBVK9B85MMuZ0zo6Xk37QeVVvQQ3G+keZQ0GQ8bmvA\nZQr6012Ciip7NIHUNXVKCz2WHdyqug1i7Whg6O4s1uDm+YUEOyZyj4n7qs8X\n4+OhlSZ8P2tnJx6Y7JahmxCX3EEPwEy7TrSvX6oXL3WTXbAxK95xcEFxXihI\nNmnctwA/akj0+IcK5q6sNyevGRHh9ZiHoFwekFiKoaWkN7CrmMEq0KOQGWq4\n6dDzrZVa37tA6jHYPYqJ3DYE/diNTiUIq+eyrmdZ/z+Q5DW3YkU/pbICuxoR\niQekfYQitvj3BpEA8hzXjeVv2ZEcmOT+zVHJf1IUiH5mc6l4HMgASgy9hJDb\niy5arBUgGkCZaUNuY1s1sr97iXTWpIU6UrdoN9Dbv6BBAoXPQz9KnLg1Y/n/\neymeXnBm0TQxDttUwSDL++vOgOfYOAb1x54U3FECe51frzuO4IKrCxFCx7qC\nZGu+\r\n=zmTX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```tsx\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```tsx\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b23724f27bc5ec384c0f2c1bbb6766aaf32b5596","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.796"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.2-pre.796_1575856744534_0.05051826284024363","host":"s3://npm-registry-packages"}},"0.9.2-pre.799":{"name":"piral-pwa","version":"0.9.2-pre.799","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.2-pre.799","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"faeea7b7fbe9de83acc4ef812386e71a0edf8764","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.2-pre.799.tgz","fileCount":26,"integrity":"sha512-AXXtZYAZxGBn8Y3QCPcAKhWAWdnVehX7J0Q9TFe7hKPltIZEUZy2yFtWKjjUNVZe5KUybDmf5Icod7Vm+EUn6Q==","signatures":[{"sig":"MEYCIQD3NxrtHaHliZfXEqfjqCTqumpGaTI41hY0kIh/yOuVuwIhAJC6z4oDN+7ysmiZPLQmrtQGyBFWXKMaGFO5Fufbq4dE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7uBFCRA9TVsSAnZWagAANl0P+QFRZXy86sVx7hOdz68F\nRkkhLk7n9OW+l2QxRq0IXm5Dmdp4sjoWGNa/wDOz0Y177qTGxIT1fA0xo75b\nT4NkgZcZNXwAwRuTsImnN40wCEyng66ZNJsnoEzg0+N6qLD5ff8BJ/p1K151\nZJsCG5QdJxdJvbVP09RAZRXbVecBh7DXhRMi5kJNcAZcYt2jO5EvwEW89OwG\nFqWnb+L+YbrBqUSv+pd9k8QjFjpxE7oGmaHqDx1t5R8LmuXGhFT+GVhiXNjo\nBddnANmLDB5wPlbQEjpWagqEUz1MH8SDs2h5w2/7Fc/9A67KJWbEd6tuog88\nsZT0LQeKvJ2x8VOPBsCWmCm+chojIMl/pCyL9Jq0Mc6Ue9N2vwfz2yfdgnF1\nuYMCXniQJmtQMN1D10xauwD5rnh5lp4u9VQokays51+DrD9MAAde16yqWGm1\nB7fQ2SuzPPl7QiPEx4MJPb9hHZwAZvdt16+M3PR2kahYsuDaySKqF68BG9hT\nd+HCgWpVx18TQpNbv22hGh2Mo00aMAeI1EPGyey4b8tiUTBXC4UzFNFhsZVK\netgh5OKoYn7SxQfqb1k17N07R+ELt57x2Nh8BhuO/Iihtm9A+0BKyNpy32yw\nhjfSlV19YzWt9Ve4EtiFIpukb1LLgb0TfNzWG3rk3f/SzX9oQ2lGgU1gAd8C\ntcG3\r\n=tExO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2853163131053dedca749cee0d2e12ab980a82a4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.799"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.2-pre.799_1575936068966_0.8979422114202789","host":"s3://npm-registry-packages"}},"0.9.2-pre.802":{"name":"piral-pwa","version":"0.9.2-pre.802","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.2-pre.802","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"16a32d79ebfb7eb65c63401a5b45c899594a656b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.2-pre.802.tgz","fileCount":26,"integrity":"sha512-ALzrPmj4/x2iZC2hLYpxDBIOh3FGvdTS3QbAcnGzQSrEwmatDpMvO0VgbKavHDKri5te15FSHAnCyCjtVzgyeQ==","signatures":[{"sig":"MEUCIF/DhwsgiCRJRCGCPz+k+1r84oFg3K+csNU5D+tO6ajaAiEA4DgQmVYEWuLaFKIZ5LDvL5sIoNnV6xFWJD20VZ1Juno=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7/LJCRA9TVsSAnZWagAAunUP/jahRVSDcHlOIQ8HOmTQ\n5wq794QKV9SHD3AYQBvpmo52rHlKxwXcsIBQ33V6tY1N7jXdETXOheVGC7/s\nXz94W68i4+SelpBCQF11xQS2PdSN1AQ3SjFsPOUCJX5+HqEeCzZLw7EP2LRz\n7sCfRw7MB4wuyepZ0reb6QKdUqDkWm2o5eaguF/jVysrhZ7Ufeqze2wfx+Zl\nD6YJlDrp/CbzaOBNUFcPBlJ+Ee9H+mdrjLUABte5nl9GGMfysfnTSOqKOsxr\nNOANBLlc5XTGQ3GZzz+GX/g/rFbFyw/TexG2Lm3BsnWYU3qUkXXuc+LFcxSP\nsJo1CfEZ3lq3gpc08D7kUqZEa1NKYR4Zur/47QZujmvOi10NpTIsQUVnER5P\noBzdKgkoMflVFo6coIqijxr+CH6e/gOP/ocfWtBxDhROiELt8LbKA4GTpWgt\ndXCZ0HqizClyYlpUJ9bmzZTzJK2HznatbAF5C6/7Tn/vBYnR82BqXZRuC5+u\nJBhtpupiMjVG8Ss6TkY7IccfppEkJ0OA0kzuUOPY3fJR96/xOFlojUiR4R7T\nhUUYHkXgPirdIzD4tk79s07dIfzcAFWg0+MC6fl0v9oWDp/qSI7SLJ85dxEr\nkOnV62j5NYak5NyE8g+hIgocM09aeNeRy1l54Y6kuq7QxlhVz++1f9KepluF\n/Qka\r\n=ikPh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"104431a169c589745fb554e4b5daafb4e3935c7f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.802"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.2-pre.802_1576006344984_0.9001997128196588","host":"s3://npm-registry-packages"}},"0.9.2-pre.804":{"name":"piral-pwa","version":"0.9.2-pre.804","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.2-pre.804","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1e8cb4dea0eb3700c9129bab5dd52345f870e68b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.2-pre.804.tgz","fileCount":26,"integrity":"sha512-2JlqTZFQO2C/O5WIdQA7LrAfjGa6ZtppYILeRqzrN9Fa6I83OwwNQkRa2F9QX4a3QzTr4B5Qha/vPWZRFJIJOw==","signatures":[{"sig":"MEUCIHpOBovs44NylgAON4CkPCFfXTz+/foeXOHfU1DmvpegAiEAl3oE8J+7MYQzy+esizM38euc5K4LkhjjyQBCco3/7L0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8DZsCRA9TVsSAnZWagAArU0P/jRdHS62RNOTBa4gM4Nk\nteBgCv+aCbEvDu+7akXtdvSFQjg2+2J0z/ptdEXBIbnKQGL6djoPViaBjPkb\n6QMJ9SI2OO1gPwnKnvmQ49+92OIAoedtdwUmwPewlLy5tGmuZ/HDW2q2AcXZ\nUEkzkwbLO87P3AL23SrHRTH/SVJ09fTo+d+Ycx3/lm+NOTpAoc4uPWyC20z3\nNWiJhue3W0NmJKXPBRd4hRFTDTFNGZiXsNt64P6UF11zMZzeOD82iJ4YimTB\nhn0oeUZzCnJWeai0vXd9tiR7rV44FOjw0SrLC18chm5woXmQlRqtady4qhOv\n95OXLsopLKNmhtvcwcrksB8PVBNX94uTFxidmYU9n2bezyFOFhk322m85j2C\nlFJFMmob5XpTF/TooPxZoYrnOeBZeSJ9V2WtLwaXsQ8qyzp8IlRxV1R/cX+b\n55NavNH3e1F29nKAoXJIJinWY/t6cDgp56Hw2s39NnJ3r5E6rkGtizUMAXPO\nLMYdwqX0yzImAeIwrHYfCUE0V8Ljeiz2LTtcjDkTaRrQlasFHHPzz2HOugFO\ntsvKHjgoYaCtD98ePznHhM0U9s5K/NTHUwxamT/Ynf0eKOqwQ109yPUnpJO+\n+unS8tyj/IBD6eXDtLlGXLZAGgXZMgtCkFy4+SQFYpXbTOI9JspaeILR2MdV\njJKw\r\n=ePzJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"25a519c7533b07d09c59f0fc2bbb1de1209a7ca4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.2-pre.804"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.2-pre.804_1576023660365_0.002533235549342816","host":"s3://npm-registry-packages"}},"0.9.2":{"name":"piral-pwa","version":"0.9.2","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b67a6920d533ff1840a27c02e4c82a89a66664b7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.2.tgz","fileCount":26,"integrity":"sha512-yfBHzHoIwFrOPyEnJzXw+yym9d5vvWKHHfMcD3/CPaUVgMeA9ZVpkhli9T82HJN8bF6buophw/tNOIIA2ExQiA==","signatures":[{"sig":"MEQCIHk11VN/f2pcuWQpxcq/wtMWDiCl+YHNnmuUicVbFeBHAiBDNtorIjT6FUYgvebPFTZRvZ2GMFBjUNiVVycHpGzvlQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8JPfCRA9TVsSAnZWagAAQNAP/3TXbOTU2zmUUerIeGPD\n5iNFFB3QPDn5ujPi70teK8UA6gvtX0ilsfGYqM7Mft9UCdQROrNvkfGzCxjk\nR6plZherUam7SWmKjl46aCTL1mQV/P6kIkhF5dfvtPgNV5tYdbYNKpHb98FK\n0F7dLGLrsOClYhd2UeOZuU6/m66f5egtPlN97stmhlG+j4jpj/o+1bJ4qVVN\nO/Wb/OKwj2oeFaFryDDJ4ROSya40zGrTNi8ChlYWviuFyNGcE3MRx3PN6Thd\nG379To2MazXmS/JhLLTZZauLuInwrtxB55MJEtdOm1sBOybVn1hTfAESrHEk\nsDvLQ6rMvWtNDN+oQAOK6xqqrJsBxfAWg8pL8J90ZWnTXj7ERXrDUYAL0L9e\nkCMwnH6zcVxGgI3seCZMk/sGB5lJyKN01cqq3cOuU7berFrfL+Pb2sB+GhPJ\nWJZsYwHBNFv4qdyP6Cl9ulFMKoiF3x5qIg4TCmnmDyMvwqCRRxHexr8jCwpm\nox455Hdxyv6iSAYHETmwxx1ch7y51w7KNZSVHYcgHGb0N5m53uBqNUNu8eWk\n8lQLg1KfkoN+SAcbCSt+OYlLkETJh2btHw+jrt46w375cXfuJSF7pP+xq+Ds\nk7QG6jUXidl+8AfdZOXvvKqqkZjGPrcCk98fUbaD5GTG9PUgGIb1GW3VxsMl\nOoTK\r\n=8FS3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"cea779e782e08b2efd4104b5b6fef0f286779cd5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.2"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.2_1576047582602_0.6837556015811603","host":"s3://npm-registry-packages"}},"0.9.3-pre.808":{"name":"piral-pwa","version":"0.9.3-pre.808","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.3-pre.808","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a9baa132705ee03e115004b506dbc189ca9d59ba","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.3-pre.808.tgz","fileCount":26,"integrity":"sha512-oygxYGj/8CXsYzzkPRNIIumh8Dk8rgtTKb4/bMFgGrj9e9bBvmZOs8MAu6mYNwGD9IaSRkPQMERZtFxPwftskg==","signatures":[{"sig":"MEUCIQChaYylzXkF1RbrnGzJtLAjqTXMAMmStC+Ua625HyTHbgIgGX9TJ0jAG+YAkZum3+63op2f/wO58m1n8AsxfwBeVVk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8t8LCRA9TVsSAnZWagAADVYP/0BIVNnjzLuGGaDdfXrQ\n8VY26/pMFOL+6Sgyo3AH/luc+EdI+XHPI226aIr3XRIx519dJuvnsLMr5C+P\nSTnN2LLflOFwk8mtulk+fucGeW2/iOdjoiA0f3yjj/TtEf4ywalWUQALSGni\nTO2o6rX4zgpj0xs2du9B0791q31IrDrsHs4k52t9D8hdJvF3lA525VmrRk16\nw+AQDMOdQv6i8asQerkCWUXMgcmB6xjxCNSIc29ADDLq40o1p0Qqquht6viY\n+TfY8U0HR8Ng3AjTUNxeRX04VpgkmrerrZ29PUxvGqq7jveOPfHAgNomAR+D\nL/KJFCzi9EKGOL7XIbRCZWPjo/YkBpCpRnGQKO1RQNSmbVxM5OZ6U5vceDI3\nby5Kui5PxR0V3tSYaagLd3bmZwevZzgzV5oaBH5TfYbqvQbn5cB4NdZZjSqD\nLAWHk4AwXvPSJK+mcG9p92pGMv+yPFXZd8A7rRCgixtZdnU9IthvLdK/CvD7\nuA+OMaKVcpxxC/T62EbgCY8/f2jvchMg1mJvdBFZ54aAU2B7GSJmi8PlOg7I\nuv1NlhxEuFmwH5oECpYYbTPgWC0Xh4x1KPbebS5WPyfIf7zeU5AT6N+NCKu4\n2hptgfOx87xajiHpTrQ1MrNhSXimmTHEyQoxK69t/NcKUYVVakN6k/F7pUFc\nIgCb\r\n=psBG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"987fc7d67c8638ae8897ac281f7dcaf9aa67a295","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.808"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.3-pre.808_1576197898694_0.1543045824138667","host":"s3://npm-registry-packages"}},"0.9.3-pre.811":{"name":"piral-pwa","version":"0.9.3-pre.811","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.3-pre.811","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b440157523137ec1fa11d4964160c8e321914568","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.3-pre.811.tgz","fileCount":26,"integrity":"sha512-OLD3NTTsUev4Rrpz5dluplu6F7k4fyfGojYgUBXAm/wPJM5Ufsvmj3j+xD7V69EFQVeFP6LD1o/Gdf/1OmU4vQ==","signatures":[{"sig":"MEUCIQC4QI5vtu6p8xRpqqjWX2dYktvojv7bSB4Iybqxl81OowIgcM/CRDAFeM2Gdw/bPm8L82itw8N6p8scmSDW+yU+5pU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd94qZCRA9TVsSAnZWagAAfUIP/1NS9szGXT5+n2ljiJq+\n+i3wqkzsA14bcxlQaiziCHRFgF4Ibyp3wxdg9yOdUVDtVcA9t5Bvq/Hvr4ws\n1HTmeJDrYxgrF/7f59n92TrNjpMLZQ1mSA737bhh9vQff+OUDfpy3vctkQQh\nDq0J33lGUA1sIBKrQmn/Mdg2tLRFw99dciRqc1aRVpDd1cUBO87Yi/avcCyv\nYllPzLgiHV4tDCdmdJcq0Gy7PgLF/CA2QeHgq7hhjetJaUKJ/YQm6zhgGVT0\n3m2hVIQbicn0X/XvfwcA6szVG1ZbpweyDni/HVTHo0o4V1H7RqpCLwAD3e2Z\nHbW6x7yeqZGBy0tIXDF1R5YXSS4gOmh1D/9Q8koKnLkDHdWx7xub4PZSu1EO\nsfZriKNLSBnb+u6zNxfsYtSw57d9BBseNnhmG6od0SXhCf0SAYkfLk8GcsvC\n1h5atNuAeDgbJGpVhtGx2W8dtVZ9iYid6DjD9RzMBqZKdK5OkCCpzpRaLDkd\nHVjb32hMkTAmLrbb0PU6CJKIkZkxMe5z07ZITmTTK8HjkBTe2iQa8QbliUKr\nrfxV8KWzH+2KGCYJkwovr3dsbGj7jVs21rNXHo4SDkDNwPkQi2lH2WWytEV2\n+A70qjkdwRphMY+N06gcHVlVUSp2ZsfD7cmoFsGNFtte327BvRB7QKVIcIOa\nDCey\r\n=G1b9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"959564a1187da704f364977b2b1eb4c13075b7e1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.811"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.3-pre.811_1576503960637_0.4549980598853858","host":"s3://npm-registry-packages"}},"0.9.3-pre.813":{"name":"piral-pwa","version":"0.9.3-pre.813","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.3-pre.813","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c91d1a9a71a6816307983cf4ede25160c1a354fe","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.3-pre.813.tgz","fileCount":26,"integrity":"sha512-pPKqEYK5qdiaJR9IHHaJ92h8/46EHOPyKwRJpFoimyRn7R5LvNu1SaswTw3qYVdyj4ZCcTUpxzLihCSj2w9mAA==","signatures":[{"sig":"MEUCIGLCmwOZ6SdVk7+qJlF0y7T627WXNETbZoTUFkDNEiabAiEA1egqZMm08pc1VDDi/C+M1Ym7XEawqmcdho1uSJcSBPw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd9+DGCRA9TVsSAnZWagAAnowP/2B/E3keNw1+XIqQwGLe\nLOEwpt/4I6JV6uRU4/n37yDnYcmAGBgRk8hoYbL6df3wI7hFsHHxHjggGB4U\nkkzUxqv8PNHGu8rmxnS1grboe3+M9yuxsyradSJ8xDU8wucYRwU1lZf9wiob\nyRsmm9iZQaPnIWGRG0hgYQW1aQtlw0vhKIbdaIKTHRPZ2Dwjw5B9ylIWjKVe\n82NnCZaYiZMRsgHBWysxDy9aPq+1zHsYUueREMLPg4uX8kGMdnYmj68Y7MVa\n98G53gAWlE+Um58BBHo/niNZIF4yT5TOSOyolgl2gIHSj9N9zFqiGDFFj8JE\nmQtL2UIEfnATAdVmeZA/bHmx9JoQWH4F7SKnZOwHZsS2eO76MB26WGf6pQVG\nyPfD6AqJpoL8GsGAGRRKDIrx0FLlDDM6um0RrNOdxurWK6aC7VtoNiKtQrIL\nY3m5yfSZE7WWSppxbEA9W3wJl/6bsKsxxFiaX5PSwwjw3p8l9fkwOmR37qoS\ndSvarlVoyJ0C1g9YTTqhFlsArSPmxODSgiDtxl+lSorVf+6IxmoK944gvzr4\n9e8OA+c2/+cUCOYI45Bi8xuSuz9+K7N2uQky//BxDKwZ0tgcP9b/xxYlasxv\ndyhZajREJ50PiuzncWrrW7AMv3t5mW9/uoWy4TTm/FXYt/kpvRDevqcDGzd0\nadDQ\r\n=oqZ9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"86f602267289f15d7871b033740ea7b8967dcb9c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.813"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.3-pre.813_1576526022501_0.9984790571777593","host":"s3://npm-registry-packages"}},"0.9.3-pre.814":{"name":"piral-pwa","version":"0.9.3-pre.814","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.3-pre.814","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7cfa2bb856fa5f8b11ece13b2fcd1f5a9c05b112","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.3-pre.814.tgz","fileCount":26,"integrity":"sha512-YBxWmfWqIDvzUQ9v6F/NRdpkvTdgkjR688jwNjBZf43d7pDMZkeefmpa0SRjqmVKxxgEsRDKnMRRjqL2lRPJcQ==","signatures":[{"sig":"MEUCIDZr/tXg53YQEcmCrzSVFivXD7DHbPpCNRYIzmfD7BJ+AiEA8DPRfnSIZbsVk9NDY5bwG88lpmDkEj0kl+0S7Wt/a0M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+BURCRA9TVsSAnZWagAA3j8QAJaYJnRvI0TwSGj1jXqx\nIQmKZGw/qpwGde3aT6dr99e5Vo2jrEXxNxw20XHfF4EaS/tQUQWIpuqoJzot\niYMZq2bCTFFw0H7jqesG/23R0aHLoGHNY8cKvKwczrxcWcAKBeFjAcfAT4Ct\n8Ysb68w1caAeRI7gSV8f1j89BLmBOW0BNCi32tvzjDBSK5NPEyYAfSzSj0mC\nxy+sS14z7KGLTixCZPwiNfMwOr4VZu1ETQVJZ5k+MlIAotfhjz22lxs2B033\nZfHGP8DEg4x4LYKO/iIUWvWCoPJyyD6bZExBxQ3Iu5LutUGF4CC9kQD6yhPs\nueLg6fjmmrkmobfPk5A+jIqXAQ5REmX9ZsMAepSItucOl2NZtPk/80GjCOvl\n/+q3H9oTFg+OwyI4PE/K2gaiIqLXNvMeda5L7XlgA6YP51q3KUgaWc9R+1kZ\nwDi3Wrb6hf37kF2l2NdLc5g9kxVFX0JqS9HeVkQHAX5PLHbl5Htytf69rEV2\nvkE/mOMKX6LEgcC/1f42bxdjuxxCG7w6RNsSrBm27/NnLAtAdmYfq9AGz3Ex\nuRA5iqnFeIByhZoPDTK2qAcsRvFm9dMi7Obku+uOhle0dd1A1YrsYdNLdD+j\nzhYn9J8MCtG3bY6Uk/wFHUKw+v7yYWbi/9ggmLittgO9nMRSWiloT9PefVIp\n8Ppa\r\n=ojvu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ffe17d238dc042d56ab11ba94c5d8a64117436ce","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.814"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.3-pre.814_1576539409095_0.3119624659678282","host":"s3://npm-registry-packages"}},"0.9.3-pre.816":{"name":"piral-pwa","version":"0.9.3-pre.816","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.3-pre.816","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"651624bb879fde61ca3b97650f107add73ac76dc","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.3-pre.816.tgz","fileCount":26,"integrity":"sha512-snEwDUsgnb8sUA84GI2mLJcdTQKer4HxNIvttL4cc5AscsGVYm8XtOHjWctc8WFuP+wlGDwAZKgJlJLS/idEEA==","signatures":[{"sig":"MEUCIQCiOSC5Vl9Ca1TLncPQnGMCqAoKHkH2r3rA3JKgb0noJQIgBLhEgj4+8gxglA6AC4ILAQRlIVw0GnySvcfy8GQlnKM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+CosCRA9TVsSAnZWagAAFTgP/3HZ9vPODJkW8so1Cki0\nFvlVMHq/OlwCdAoiXpE98LhNQ/uvYtBpm5GoH5IrNTuHD/VxuO1tM0d4gk15\nl9aGM0gDzz1lZJGJgTfGEA4Vnh3EeWoddqghVcVGDUZmBzoZtHxNvygsObc9\nEAMdVmdCf/qXpUH7mD9A2BSwEIdvJo36MpBsIAm6JORrSvLP3zuO1XRbWtTZ\nBj6mqzqI+2eXrOFtwn4VWSRVMwHw2n752Nb1AsNsrPVoIOX0KRUf1XSiBt+5\nT3TdYbQWFjiX6CpVYcMRe3Sx2eoMeVWccblmi4S7tHUc7G6ifSZszhmDiXdo\n15YmGaG0co6bNQAzCIwNU0K0KzluB7DEkYE3kYZAzIzr7skhXZrFWEmczXUI\ntBD+Ayy3GGMVX/p9784JHp5x885iUw996nYDvQPRDhlq/OtfTPW8N1Qo4kTG\nZ+SwqTM9c3RN8VF67jgZzGWhOsTdD1shqRSzB7TKxyNPHBlxh/fPshZwfLrT\n8zTwgpecsLrRrraPeG0ddWXwxFuI7rz1sTdmsr5rytqdrCVvsUxnWlEcDCIV\ngFXTpOwFWqR38pNPwbbMYaTxQZlzuacTiC5FKMlSoxtVd78FhIw/T5m7Qhoa\n7GA2H/b3Rj+ZM3HUcx3DU0YNs9e1DkX9xpmw63iwHpfFwiHA/c6+72yb+6ns\nVIMJ\r\n=ZJhO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"63d278a1cfaf6788e0befb7a0a110e5a5bf3da2a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.816"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.3-pre.816_1576544812176_0.2797103676015269","host":"s3://npm-registry-packages"}},"0.9.3-pre.818":{"name":"piral-pwa","version":"0.9.3-pre.818","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.3-pre.818","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8790381327d0445249fcfadb40c42e5b581dd9be","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.3-pre.818.tgz","fileCount":26,"integrity":"sha512-NV4MvXBVwiKLQxhiiPlgGjaOu+lTpWdps/EJLG2Vf9cp1eIDZ5eccvSW7uB2FWN6I4ZON3AKWzj0ztXLBm/rcg==","signatures":[{"sig":"MEQCIAVkMxuHQGw/6uxLVkUrpfICc31SGe8+L2V5eDtaVo9wAiA+6RrdveK657pMBBco3+LSUMT35fL3vc4l8QuBxpjX+g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+O0jCRA9TVsSAnZWagAAHZAP/AolDiZYCO+WDXQCUFH8\neM5MbjYksRh5uo60+nWB0xvp+43uYy9XRL0ygsFQbvKlnpTp/PJZ8B9UAPDW\n4J3go1xmYxdDMqLMnrfnWcRjQtTq116QVW5KSjp3xsRxey5drdfB5tmRHHYq\n+McTCQuNdPCn7kUislKE3dmWtNfuXMI6IfGwVSM56u7E3rL44Ao4A/lp0keV\n3GUoBhkv0+eCgB1tuwWK92PPoacx4CygSUbNgu1kn79NwT2PGkLs6iydFhW5\nFS0zUDd16JtJLtA9PgabBCwWcJ7Aib8ZrbsieEgJTixITSalD6205nKHO212\nW0rLJ7xQXMW9QyLRXpxza9QrtMScpd7ip36uMtnl8B2yCFbiAgUQkoYM8ELO\nhpw0mTdnwCx4Pt1syUOs7mahYDe2mDRWaAdHw5Y+DrHMEPy1ovwuTs4oLyhM\nCHoV91v4ut5fz+Fxio/Fow77RJnVHuOCVKTv3vXOFH6Wps+F4aZtVzBAbYfX\nnq9uFnUy1HK7EroJmHaWMW7r/m/rVPMMUsXycvwbSfy/XPytODJ4DhTbmWg8\njKWDKrMYh1aLzKUlkBeaJvrByI5ac0JLmL3sYtXt+lumXSYG76SFbudfMVCo\nD5lZDgSSowAyZKwdvDl7xnqeRI/MOmYYnNrJ056ySOfWlOB+f2O1KdAR1SCK\npTsB\r\n=wGRk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"419737e5bd29f42c9b5397d2eac59d7069303903","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.9.3-pre.818"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.3-pre.818_1576594723516_0.4373318525368528","host":"s3://npm-registry-packages"}},"0.9.3":{"name":"piral-pwa","version":"0.9.3","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cf3923dbc73d76ba8e96a9b2a7efc1ae7105ebd8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.3.tgz","fileCount":26,"integrity":"sha512-k2uYHV59OHzM4tgjSqKPbFLF3HdCIfUSV8V/ZW9PiVtyJV3r0uO6Q40wEwJPYflTflp8VIYzqR2LKqAtq0SffQ==","signatures":[{"sig":"MEYCIQD04FziAXFidcf5mzUlaBowtAP6XNnW7cHCVaKcqBqGIgIhAIBTv5wpUalARxDJFsL/3OqraXiNcQavUpI9EPS0une2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+QcUCRA9TVsSAnZWagAAJJ4P/0oqBIyBK3IyHtkQ0kto\ngdIW5Rh50+8tx5vikFFr+QzvGEYR/uOvdjeasoBDfmAeIpOhulsojeJj9m6a\nn6XC+cgaed6ePtpLEixKB/xQUF+U/Sw+0WMm6GvSDKgvtRlQ9OgNGwQYYtZF\nfVENMTovs3q1qVPjlQB5xSWxaa1HS9BL6t/yk0i+ecJ4O9b4HzjMHf0GhGtt\nYLRmYlm8Twr5UAUtXAyKMWngr6q0D4/2egQkEDmG0d+YEF/naM6MERLyYtjV\ntw91i3K9ux/GbFwkhyDdHX6UT+dMO5LTJvd8dU3OLY2ta1SgW5vIItlTPxaX\nrWy4YIWCipauW53LrYayKHF/j55pWto9tULY3WJymkVaInmAfDPU4IlsAY8s\nIeucQEXk4GZ3nPO9mLtwZpxqd9mVc10lLJbsaXdnOkGOXyymd4etPIRNGwNT\nzr2pQbZzALObT/NC0I6gT+2o89Hclw5T7ZfwCBne/xl12QfoHJohNjNAVJ7t\nD9VObyqspH0bD8UjhBgisGvmyoCvbTLPpX2NVqAmrXoUjXEUZmMVe9l3K7oE\npo6f4/FwwShgku065+143K+D/CpZ55oojNTrkVWOoA868MGjwV4pt/aPjnyY\nWHw/TmzirNisJVgOeef3hyCrKBLH0i7u3Jf1ONCI7/7jZ0AqISLxDDQ5SEjS\nNd40\r\n=RaID\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"a079ff637821eeacd28f1209593b778e370d0366","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.3"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.3_1576601363834_0.3738090108281149","host":"s3://npm-registry-packages"}},"0.10.0-pre.823":{"name":"piral-pwa","version":"0.10.0-pre.823","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.823","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"084b2c3ce046fe793d0d02f22a8d25af775be7c8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.823.tgz","fileCount":26,"integrity":"sha512-KB1wJIwciRmnnLVtEQOmhZq99EWQWayi+KKw62eeikTUa6Yeyf7lBf85JG2brhukXxInGu2OcDPyI9aqsFgGYw==","signatures":[{"sig":"MEQCICAJKG4jOvRoIMEOcePpqpBBGdGe/w79vwJQgsw8uV+pAiAeuxnQyai3GqRrPpWMhsFU2RiObVly6R+aL/m4Q+nEUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+azYCRA9TVsSAnZWagAAhv4P/j1kkVsGnItHkKueXgSr\n/7KtZWDhTxRDkQ7pMIMYGux60J4VYYMHICOWbP46AJ7eIIQBTEoITwKlaLDn\nefFh/iRLtBq9heXAqGOhXUO2Fx5Tof5jo5l0Dx3h0mloaB2ikw2kZxF3tqn3\nvbjsPI5XPQPX482YC9sRhadPanXY9qQd1A30RLMnKHfoSGIErLcLhovr991i\n3mUKGPLpM107AI8tp4oT55KCdyqFONGM4QMxeyEayglNS7Gx1L/mP1EooA2T\naHRkyr1vG9sb/WpnVRfuey38mf+6P7x3hfmkv+J167Vm6ygI8JkIcLU50DEA\nDJdsFlAJET+17PvcVaeGl1rAHOFA1/4X5+hdmnNoP4PITbl0wLvU/aDptppD\nTZCTn+zLEGJ0JeLDa+rW0ftj7ElJ4a/6Gxk6u7o+icKOJ/7tKIMYufsnmd4q\nyH0SnWJvwfObPi3GfsWGglI976JSmIpCReEVumPqe5zl56TElm0gQSfZbn2i\ndsfZyWr6P1q7CMxbRTioBrHiW44Ul8LI0JC6ArWF3ynGyTgvwQ6U6vZttgEp\n20jvsta2zRPdHVnxNAJQ+hUyXUFZAjpLJ8ZHDDyxppkR3X11PZSmkfvbwVIF\nBT8KSgQBzfaPHaS5ehPvpY2wxEFaToGyIl3DBqWyL2/UNnPksWQe+QO0L6sp\nj5ln\r\n=OfEn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"6ffae5945e28b7d86c7701e25aa3b2698e32a985","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.823"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.823_1576643799707_0.31236153035426817","host":"s3://npm-registry-packages"}},"0.10.0-pre.827":{"name":"piral-pwa","version":"0.10.0-pre.827","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.827","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3bafea94df7cbb4c131e491e4beb8ea253e3abdd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.827.tgz","fileCount":26,"integrity":"sha512-TlilolGvReEvheoWxXlm1qz7xsrizuOWXYqgEUveE8Gmnpjncpk/DhdqvZrrgWs34OXtUA42fXNc0pEP5ogltw==","signatures":[{"sig":"MEQCIA8Mds9JSvNZMmu4jrYh0VcrmJyPmLdcPg3cxRKlTqXoAiAqImd6CNxT71PaKFvGGgo/AJr8JncL4MRy0iVyCfMwfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/KXUCRA9TVsSAnZWagAA99cP/iCPxRmEGDD+DgKFvGig\ndTUtMj6aQCLY3XO7fmq5OXT+RycUf6JRsHSTHAM+YhvlNaFHJfyDKj01q9ce\nyEKO00lZ52iE+N9UWJHveUAvNITG9rgAW8+IH/Ju6/8L7zqpyyM87ZrqrMNk\n0cvC+5yfVjiOY2KfH28Ec/xSrr0crHsqs5t0W8L0Ub7iQ3UuwOuOAhm7Z69w\nHhmMaxI05l49HmBNLcSyMSddZ4EiPjPqIkXHjJ+VJZtkzKChEMAARBQxXdpj\nJHK8hE38h50uvApOMtzzTPwvX1U2jArBaqNiPn1OUBHUAZr3Me4h2VLirUNS\nJvgsPa4nv+WBv7+zA2ciKNtEI5mLdGDVsusB8z0EO4hzxBFThM3VSgs3ZpA8\nERgMWEaLAMYiAptAyFtXUJpf7I9SEHoHHE1gmDCqrCD4NHKDOJwQ/JEMn4KR\nfqxORxOUwh3t+HOgHvjsnE7Sp2pV5YHX9B8L120epiKzWcbnPs5oBWxChOln\n4OPhlmvw7rPxilS+lVTmWNUI98yawnweCeOboENSQ7QfwHyt6MllRnX3FgBe\nIvfegoZCkRd0sclYHPeGO1yTvMCk4G4fzCUcywskEC6MKv0VPYiklazqbdcL\nzNU/sCERDbiQfRBrVbIj1F720RdHRMI9n7bEIWIVNXxf/NLW6O2/x5CSaUMm\nRIOw\r\n=psDs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"63305e6256095629479040df80d7616bbdd597ca","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.827"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.827_1576838612500_0.33943963209082617","host":"s3://npm-registry-packages"}},"0.10.0-pre.828":{"name":"piral-pwa","version":"0.10.0-pre.828","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.828","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e309b025a510ed30150264d460c6b3ce2b389a7b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.828.tgz","fileCount":26,"integrity":"sha512-NHDdoS2+kbB2IS53EWxbVqGIld2qTGULGflbtxpbs70wVZsJZCoyggdMJTMOIF2gLthCjXeHB/zjnABGic6IZw==","signatures":[{"sig":"MEYCIQDA+PLkHsxrPrSO3jKMaFhqw50MQQSOFvffFmS/xMI3sgIhALLkssHhw5Bs8yKTkDDItCiEMX+LuNS7EkAyBvRsK2lq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeAADVCRA9TVsSAnZWagAAVtUP/1Q66N+XHZgSxm4UkVBh\nmbscFkONXp6/hQYi9GlsTe32HuQ7R1stfNfS+WXtqgojg4bljBSrpOrjfs7y\nXtvCOuyoYks+/DZ9QJwlTToad9CZ7NQn85/QKhWKxmThnIFrG0aHP+5hvsR3\n54nSxe/s3GvxsxmgwXOxMJ3S9eWVAHVQkaax9++cer9fzDIF5iZD1Wf/Tvr+\n3HSH/8uoWIJb/ATwJd2JLWGj6C4j5jchYC1YP1wF7QQJzpsLNksvar9Vu7JF\nXBefx/FtA1RuuE1TDzDaT+b0PvRJrpQsyt+jT9yYRBhFwHnN0maHoYjif7GL\nvx/KnGt7HoWeHRPsk8oXYFciKbpeHnx/5Q0VQ8IabN3gxu4y7QYzWcq4w4OI\nqzSxn8gLYGc4+vkGqFl5LBabc/xea2PEYp+QJ9rqyDt3ZYn0m1XKKUFCpAN2\nEjxXEvVUdFnC4sA7SmOKoubgF0IDVsv1X04bFg50hBhLAnxLg1OKXTHIk2to\nWam5FC8L5eR8QtdiYE3AaCDN9E1vjFuuewomDtVTmbRBvAWOsUaxTO94Wfrm\nVVdjSe6QEtUlHu8jRfbQfKqIZx3bXZym8FVIhNavPnRt7cszYvwRXhNKbHNO\nSUHtXC7y7ATdJ1FwoPgLb6V61ZI2tMEcAhyToioOC5chL/jE54iH0VBLIuNI\nsLgs\r\n=tUzt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a44758f42ec541d9bcb9f8cf39880fcb050c2934","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.828"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.828_1577058517156_0.8225734905902837","host":"s3://npm-registry-packages"}},"0.10.0-pre.829":{"name":"piral-pwa","version":"0.10.0-pre.829","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.829","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f78a5d71322372d59ba3f6f85c50722462635f19","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.829.tgz","fileCount":26,"integrity":"sha512-ToXpKLUtaUZDGx2TennYku/C6YFQugIrZsJThLXF7fnaz165YbILwPG3I+kJ9Uy6frjG+5s4BkLISaRgV1qHcg==","signatures":[{"sig":"MEYCIQCQYnbX5rrjql9a0TAuX+Lchm7K2CskSmWL70sv3LPl7gIhANbSmM/fp4Kag5kWcrMD9sgIvHddVhgqZ5nU7hjwV4tu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeA/rFCRA9TVsSAnZWagAA4ewQAKQ8Y6h1hVeY+gH9V6Px\n5M0JTwKTcvN1Pjwg1i590MRnmey5ErrcZjy1hJ4o9u6y27NlnxGv2hr2vNAI\n/uWG/6xqTklijwhBEO4k/U2pPqbtE5SvZax7GOBwtAfPDlp0Db44uc29pe9X\nPo0PIDPuesz0GbsuWw4BCUZM+0mvdkM+jA2Kr0NPwAHy0T4LNZ8KmYpDqNyW\nkRtH+xTbijtaXZ63flD39pZ21uwpJmpedj9KVbiO0wPHWvsl/WE97uLJYn7e\nVHZxWEWEosYnvb6yyEyW6EXiMHp/xwfNS1m7n30ixbTl+YzQC+Bd4o+kjCC+\nq+3l1h8Th8pPGHkvJg35wTwc76EKw/1G2dZ8WyZ7jFJk+3KnPosxNSReFtgY\nqj58xy1VQMoysqywdLdGkKO8zq6I/tXsEwlc/W6HCHf6XKOMwCLKV9+4vpRv\njBOh/EmP31gO9wmZgBhy7dkjhyL4UV73G5so0OZwRV28FeyS5WvXkH1iXPY+\njMTp4zc0DQjFrwu3yvO9hf+O8XofCXD5yUxLk14/0CGs7WM11bFWLfc3V3Oy\nHmElNo63fnaUCAphkNQG2qDr5/pKCjak86fTFLDbPWZnxQv/3zIb9uujXdM5\ngmgfNkhsZfNgUJuA3XIX2Q0TM0l6NJ1RHXQexwtME4caZq64I4u/q/FsLPZI\nSKH2\r\n=5x1m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"94a14111028167c8f8fc045ee49d305693252090","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.829"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.829_1577319108914_0.2595642530073363","host":"s3://npm-registry-packages"}},"0.10.0-pre.832":{"name":"piral-pwa","version":"0.10.0-pre.832","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.832","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ec271626dde15eaf875b6ac192d0490615256b08","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.832.tgz","fileCount":26,"integrity":"sha512-GC57Hs8QpYX0leRK1QyB6ha+9S8MDyFv/bHgikeN4u+37pZbugNNSinsZPm3CAm7c5E0wV4S8VaS3NSk7wFRqQ==","signatures":[{"sig":"MEYCIQD+/rS2ngpbJ8RxZce4BHxfpbfzuJYPK/wWwm+r/nEj7gIhAJSuVfz23R6C6G7uiFHf4UGl0G7DcHPufZ85fjTdTSqj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCkqLCRA9TVsSAnZWagAAap0P/2mk9F7p71J9/fn5dYL/\n35psHalO9r0yLYOlbTEPKdNW8fB1D9RvfJcNdywzOW0XovSVA4ibcheufi8j\nPSbddSFSl2EIZMneHUYL0Bq/2dpCoIsD4tV0qn+vprLP6sKVc62l+6FcjJlF\n/uF2bEc/qY8WpVWANr76ebBr+Tf4JZzJ5S1+tS9j6++Fst6gfQLsXcyaD6qN\nyj+0FRMvr22z+OBVFyv2mgTw6RnNVHBsfD56ucLkxT/4R4pJ3uhLY2ParlWc\nC2gphle9b/umgrr0gLZoTXBLV6ZukFpmtCvu6YdPXO9qjn06LwgCI8UhquX1\nvFJrtbSjVucnu3A4URSKdpaE/8nP4k7bOg6u7HJdU5MZ3CQLhIiZ+5P7gGWe\n0MQNtdDKympj5WODEza+5jushd9+dXwTjwqxodf1e07MDGDdJdN4TqNhbiMz\n4y1iG9rVMd0jyaqUrJYY1msvm9WspOiPoCTDd0ve5KLME7bBxE88OAcFMARq\nFBgxaDIR56IyYgKG19J0iJOWb2u7/jrR6XeiSCvOUvd37KwaIdlcsvQLIcLn\nrOgE7FyjNw7TmY+cMt4KEwOYevcPxPW1OltAt67fEChE29gvd5SLlvFswJ2j\naxxLMxT7U1H/KVehdZCdwc8emMQ+PWG6N5Jg3BNB6rRTdJ96rS68MY7nQU15\nbbTF\r\n=Rs9b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a0cefab34906b64eb9737b210d77aa7aeff78ae0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.832"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.832_1577732747486_0.21327235896820707","host":"s3://npm-registry-packages"}},"0.10.0-pre.833":{"name":"piral-pwa","version":"0.10.0-pre.833","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.833","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4acdc8366c36d9b500a3aa049ed3996245fed198","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.833.tgz","fileCount":26,"integrity":"sha512-LE4sbnejTILwjsPEd8x1FJeIthMJK7XgA8HmZMSleqe3kJi0UEjcK2251ox+7oojdFKma/fNTTf1uC7zxfTLng==","signatures":[{"sig":"MEYCIQCN952eunTEy3Y6SlB7iCL0+HWcGN6WpR9s5DNi+o8tPwIhAKnFHJlJMB0TfyxQflzz0xyr70Dnt6B6kNIJpWP7pcHN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDtsTCRA9TVsSAnZWagAAomYQAJFE0cCyDllkNa3Yj03O\nusyDEU0Ar0uEwZL5oBB7+6+c33S86umPHj8Tgnt8+rW5yKyuBhcbTLGmsgOt\njHRpqcLYN5K1gi7wggj3fKp/mPdwXLyGCLgJPBE7Q0XMpCJC9NFlAGvJ/UJJ\ns8RS/I4+ThGglek8mEEBbGgt33LV9kqQE4Q8rYOp2CiYg7NlcJlasb+FBgCy\nw8YiLg27EfXr7q8QpOmTdt89Tqxzm7o8SugpOzbY+cHj8468ZvDq3bL2ehjI\n+Vt06BWZ0Eqw6seisOj16IDNt5RxVQlj6fG25CL/Zky/m0L9lEBkgSMpp/GU\nJrH16ylGodNxXDKIl+eeXlu0jHYZDhKBzFgUV2cGgrAkXD/mmLw780z9ymZX\nnbk9rjFyTK1z3fo9QKIDC5F6hYiW6adzF+uaXkXHMCkJN9nY2U3c+v1uYm/W\nnwpVcBOkTUi3jTmsNwj/anrsF/y689l1yYIe9o3SgrkPyxvMlepfN3bxX1Rp\n4tgBql0DHaW4/NR0tdeJc14bvyotL5f6zI2ySXNqf1HDOyuzk3a3ATB8N88w\nwwX0NekprSVqyzaMeqXVX4JqUYEvJFnTr6URmvF/ieQDjRcf8wYdJmO+QdnL\naNp/jzzxFAcPoVS1FaLlTPj8lpONz4VSeg/Av7J6kQ1GUKZ5gy7V8UdPdk98\nlqaZ\r\n=ln86\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d516ac407b61944d2d3609af92664843535a90e4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.833"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.833_1578031890859_0.34435945360448295","host":"s3://npm-registry-packages"}},"0.10.0-pre.836":{"name":"piral-pwa","version":"0.10.0-pre.836","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.836","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d801a378260f0ccd88315ab0974a75112bfda21a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.836.tgz","fileCount":26,"integrity":"sha512-vQVKH+gLXkXKR07y88zNasQBbaOM9cluECe6YLp7Xrfl2seUi9L2SbxLc9FEudcwenF3hq7dPmD/sqlxvctl8Q==","signatures":[{"sig":"MEQCIFW+cfjlGFu6+m10OO+NZjS6YYAM8gZn7qj3FrR6v0THAiBFHHo3YzjDhYz5ZOlbmM8ahYqNoYG4ENcguukTG9TXZA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFX0iCRA9TVsSAnZWagAAdYwP/iTQKpcICYIpu+QKIdfc\nYYxQGteLht5kN3PY9OaQYqt2J0xPeCk4MtZLv196YIpMXW0m+iRdYSIoZvXp\nKcXpXH03E45Zhs8fg2mqDG1thq+eKTumhOZxINwU1BTOSipgHR7gga5XvQ89\n2N1NxexWQp29EH7BYrzrzAjOunlW0RDfI5z39hQRbqNiQ0RyuefAbrdfNVjX\nLd3+xSlmO1If9QlWcElJS0PH2e4mmOWBRqn531XWGYz7HmmxCyxMeArRMGE/\ngR+8kuoM2lpk/cKN/2iOyMSyJAV3f7YNwDY8GceF0rzD4P56vf9ZQ3Tq2YJ6\n6km9Qj5B474kxx18yOR4rTzJXBFxO+aubZYe4mjnuYL9mqBqUxV5xFtAxx/L\nhWJp8gMBH5ohsjzHarxbME1Znj54RiITMJfTsfrD5z0BadUXw5Tny2ea97nC\nDfvX36jzRX4ws+uxNc30jx0aZm0G2RGKllfiuWHFVUOPtpRVy5eFjeeF64Qj\nqFOx6FSa+YS82lLCDeSF+9ynWi5pvpmPu4NHJcdhPOU0o7zS/GzSDYhuCq1e\nzr5ot0ux/VgVwYxkTrxS0wcZytx3vCv2+houH3jGTIy0/JrYf3TOO+9wktb7\nk+B1D0nyuh8aBnlpwRfm+PtkruQzfIZR3YJ7UBUNxxGPQ3/lQXrqcvooWxcM\n5lfV\r\n=99me\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7bc9ac63f57e2c4ac1c984980ffbc9120c9c83a6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.836"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.836_1578466593786_0.6377618906134157","host":"s3://npm-registry-packages"}},"0.10.0-pre.837":{"name":"piral-pwa","version":"0.10.0-pre.837","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.837","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"21408fc6d18f7e631ec204491baa7f625de9b2da","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.837.tgz","fileCount":26,"integrity":"sha512-WymqnMLiBz2YQp0Kwbcu5e+bbPd7m9DijhwLngdESsP8ifwTR3W4e3unlnHSjTiM2OtbanvLs2kjeTZVe7av7g==","signatures":[{"sig":"MEUCIEk3mk38QWUv+bsDO1sI2A4Z06joExPdmQ4k+ASW4Nn6AiEAxEVjoVlS6zcCBnaNHL8dFRaGyXDFbLrq3ZjHz4z1clw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFns1CRA9TVsSAnZWagAA3zkP/2t1WgKhrPa5Ph/My/vA\nefY5RQ3O1C5pZ0fHEGgx8WngVlNmHVT0ZHm+UE3ANnius5Z4nt5G1YX4bExd\nWkLypERfiUGNO/jo5EefIeQsX8UsD7yLMBjo+hye5AVeba5+YpT6MO39wBPX\nAjQ2iv53X2mmdUG3+jEFF0EjVsU48nVxBpoHEdkKoVGtBuQqZBUKKlblXehI\n6RYuChm0g8hcxBYOXjijdSBnNe0TVF6UIw+6LOm1LZMFcGgd8Za7phrcpFo1\n+btvK3BgUxKwJxFuPJ1vbuHRbUY5wKMOgNe8FemUb6O6Kp/XADRIFbjZFFqk\nHBjWd6OuAfDDIvjD/Wak/f8DtnKWB/LLp2ABVCoMu6repry5ZmLQdvK5PQm7\nXzTYxW+vw+BbrSeO+jmJiENKvfDs9sd/LYSWqtKBvq+EtTcY6JTTdBSBFsu5\n+as95NazJovxC1JEveyPnIMkELcXD21LBQhwgrXpTihiTgZ1LBYRPhQNdfHW\nsWHMAknL4PsTf2nwRTTwMIkyk9ZPyLy7auOGDkj7S8T6Exiu7qWnkHf5YbbP\nzqKodRVYQV4KQXcPyW3gMaq2hEMDV06vE5HmfpmygYO7IgXIFSP3ZHhpTcY+\ng/qPEHAsglwpu3VWnTEyosRUXyq/CHq1+QJx9xfJMFc5r2Rt0JYAIeleyzJp\nwyKh\r\n=Aody\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5e8fd9a6f76c1505c459b18a5a06fcbeaa77f1a8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.837"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.837_1578531636901_0.331783048501173","host":"s3://npm-registry-packages"}},"0.10.0-pre.838":{"name":"piral-pwa","version":"0.10.0-pre.838","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.838","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"655589a5e58636d7a5e4e34c2200c128f15fb2e5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.838.tgz","fileCount":26,"integrity":"sha512-gSevY1QXdHnXZNMrRjtwHCi4ve2eMnMLo50cfUUf/vwvDhB+EJUQzJjw5F3xAglStY6Om2GV+OGoqHnBJaupBQ==","signatures":[{"sig":"MEUCIGTAj37m6AJkmhDVn9LEcQOAr9sz0K6JaRsrUM7aQwQ1AiEA1nIP5jkl9q/9Q38jpTyM1rmYyUylW1I1DawqozqShc0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGE3WCRA9TVsSAnZWagAAsq0P/20pe18480hCmIPXUdS9\nI82226j82qMT7Rs4gvX/xiFndIsFRbppn++GxG/twTWla0nA+OvXa3FpReDt\n/HwZQPi4Gl2iJ3NhkhXS1zyn2U/PFkSX0in5aP9WCZG4Y6s05Hv5vyMza0nQ\nHM36xNBfqRaigB2J1Le3BKDfgB7bIKxXtMFBENNremkhAacfmSfR9lQmM2rh\nRFEKQnbPu4HeX3nwEE/IdGWa4aRu630ZIYQw7RwoXfP0DUR84krIrgcpqHXq\ncHxKxtdxZObKQLdGjfuoGP4RxnqTQd0yTm8FQoDZr9f13sR5MlZ0o/4OD9AK\nr0y5JPjO10b56E2HWg1ZwMNWkFrytI5OVdSAp7YBu2Rv6rF1hhM0Hc5RqeYB\nyxxsEBThr8RH2SHeJrs5tGKr++irMV5/+ZWFzNfumq0Gxrxj5so89gA7G4CV\njfuuK6ccidmyo0DGVIvkvOKMl59HG8tSZL+h70LRPzfz+SplRJwqbyIXhtrI\nBP0OM6e6xKK0aed07Y1BB88aREaWBEIb2CrpY9JTcHw3n2c69p8ZoT3whXBq\nyyRv0X3CGwr0jB36HBNihLDkplRGChvDrn06tdYgGAVRCI1qdGMr03Y6FeIo\n4kfNmi4c66dFNwcBmJd5NeHpOJoMyCdWZcIWfpGy63mcJphj2C4yKuhqswhv\nY41n\r\n=n0Dz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5d2f55dafff3ceb751877958c5691dfbf995ae84","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.838"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.838_1578651094474_0.09888860924159926","host":"s3://npm-registry-packages"}},"0.10.0-pre.839":{"name":"piral-pwa","version":"0.10.0-pre.839","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.839","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a3065466ca0b9f891bedde27e018ea1297d2f521","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.839.tgz","fileCount":20,"integrity":"sha512-SyemOZns2AkNDwuGw4RRuYMbVLPSaANwXf1OCiYcrtx/TGf/aPeqm7ZKRnSOdmNy4sF669frtNAMhz42PHdMlw==","signatures":[{"sig":"MEUCIQC5v6xjCa6cRO8si3iTPcE23jcz3U1imw88FZHrrOs0bgIga3QJi+EtWRiI+Na02fdDSTqOkHxvuL1/YUg+TwGEixw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeG7nZCRA9TVsSAnZWagAAlNgQAIby+jEWhleCEszDOvhK\nyJ43nXXFcGnz/nlrA0SwG8KgnkxOacnhClkhlNUydQwvOAmQQHoSMwBWy2ON\nnw4lK5aZ5DHKwvbt/URY+nnf3enFA40TwE6bjJ041zzpK/TWToP+4M7K6vJf\nknP9rqDSEHWv3wFE20FoLWQrwZVeF5QU3b2d1j6SxJ8ODNAi83G6C6K7/pnS\nRZYt5E9D3nR/lyZA65mHTor2z3FMR0ZQmlxShdyEym2JvhFlUUGWsoL1ReUD\n7vZaNByEbZqYo0/SNvitw0nBtpxLO099lBsimUSoLx3/pilTdrBr7/tOYHAr\nklE2SSLUAWPN1wsZDn6kKW0/EofnN/sC2fYFGw5+iQaaTdNMTNg5hBNvTBBx\nJEmNZ9w1+LmjTDFycT4Az3pVydBo9grmvljSrGTOkt5Fj7i/FkaBgrgmsDxb\nlD47alq2QrfIG2MvS0Jf2xaNy4UOIEJqtlNdLRLGmToSLPPt/z74ff7/IdxZ\nzTdqOkXBK2i40buA9bkNlVni3pfkDLMS1SihKZAoY/qg7HD0ZOJkWRz9ZtrC\nBZ7/nXoDxu7mGFDwdS5c15YZsoNH+3bZMc81xEFvtFj51qjQ5Is3SFNbiavg\nM1NIshpz6q7XiYNy3jPc2dVFWM9gAgxwSvpw82DvBNT4BKL1Y1Ai5UdUbI5S\nIwe6\r\n=vEKQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"33cdbbd12fb5819e531ad2e8d4d5eee03d63ec4d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.13.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.839"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.839_1578875353449_0.9390681337743549","host":"s3://npm-registry-packages"}},"0.10.0-pre.842":{"name":"piral-pwa","version":"0.10.0-pre.842","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.842","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a52f78c78fbe602542de1c59dd8d14c50408812d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.842.tgz","fileCount":20,"integrity":"sha512-ot2z7Fd9WE5d7qV8W51Ix62h6IAI44P1Cu3YMIER8gXiVTsJqSMRmPcluPnurKIwo4tpgqNLSYXYOmW2zSRd9Q==","signatures":[{"sig":"MEUCIQDR7DXC4oAgRlLPswiXmK23aR+5WMUZrZsqyT5piDQbXwIgR/jO0VbkZmr51qiHDTXgsi9x7fnlKqfaFdgyD03nfWU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIcs7CRA9TVsSAnZWagAAUxIP/R5s1HDicmVq2aC+gS8x\nwGT1gt8xbck6a4CUx4UOuUmdgnWfUeRVWYtK+EnDwUi8+ksMTKPU8TlW4UTi\numi+GDO7xyt6ntNuILuTmzUCKSq/NB1GZTLvi3DFWfW1gbNWrd9rPSwCCDmt\nlV8To3nVpJKSyMOYwLmtXyYYkBrrAYrVvodEpXbcTIgddKAWFZZzrkcMjS+9\nLN5P2QWhezws+zrPFQnebl/RwCghaGvkVk21To5l7rmnWg/AP8eopHUE0XFj\nezCz7mKEC8485abYAOAwOzhXNRdq182g3sVFwyxKtnLwKc6opDKKTOaOzkdO\nfBQl1/uBIm/+Z1RcDoS28v5fp6ZCElsNzAaepAcwu/oQiZcFwAT8UDDI1LE/\nAtS7IBYOHCKQGChVLL3EAsRJCGhIXdNnCU3bQ2oOFtquM4CujUr1D7wMwgjM\nvNVQ8Cwr+9bTGYeNgbpiDFQzbmn1pnWS7aX3Q1xw+4pWKuUn1HpNl+TyuNc9\nBM1qZgA3tcSgmEnS809GL1+n2hs7UxGJ9VpFyLvQ+l/v3fcKqbGqCvFOm+2m\nolxgcXbr7Jal8RwV2RC4ieZ4vGImxgRkB45Di0FZJqf7vYJTs3nawbNLDjfz\n6o7uZbJN6D2tuuOW7D6sy1KgzppYE6DPyD9YA1oBvNKy0GB0Rps3vChDUV58\ntny6\r\n=bFDD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"15b240d304e7a079546be98203155ab6287ed2f3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.14.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.842"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.842_1579273019334_0.2525959563405198","host":"s3://npm-registry-packages"}},"0.10.0-pre.843":{"name":"piral-pwa","version":"0.10.0-pre.843","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.843","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"41fa596b59a2d1119fd30ecf68a2bc3e5c8993bd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.843.tgz","fileCount":20,"integrity":"sha512-jyWeWThr5hN7PhoVCRAm4XlplpLU7q/WA4AexWar9bfaibgLRZr3NgIVli4bcRig35jE+MK3CN7VnGWSFBhNrw==","signatures":[{"sig":"MEUCIFb621rLyvZLge0r28HsKQgolsni4X39t8AbTUz7O9bEAiEAo0g4ymOxMleDTyRP/bGffPogvBJGSTowEYP5LVlIxwU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIuKHCRA9TVsSAnZWagAAsO8P/jpQ4lLfINGjPLZSy6H1\nYHIpOdbAaXww2K/mYWXEivZR9xY3Z2Ovdd3/JPIuSIoxZPggNe1lUvrnNzfe\nb6rvBgYZ6d1VYQwrzWb8RJRMeRm5HwUXMr2TCtGK4QqoXR/Ne9wHFjiy+7AY\nDh7K+ouNCQDABAz5mdWwwjCuwJek13+B8qX8I/cPWSsnESYtu+aynn5LEeUJ\nQcKt4lJOJpUzXsS0xtTx5nrlIaBxd21o+4AUrkl5SR8+0L00kvw3wLbT3+rH\nN1QhJcg6ImxAHsj83mvsv9/ZA5sHAwUOewPpKanPIdLiBgiQOLLfE1fVwN55\n/IBfYZ1EI4iFp4akpudIrvleA2ahxi5wXWQvNlLGNG9zYPXZe5E1jRnX4J6P\nDan/Kjpa984K1eBuIYo7K8Q99yrjXfxs4L0JX4cMOV1x3BaGmBwBYCltKXZu\nSw5vO0K8gdmCkXfgy3wEVG2GfhKjIMjpT+P4NfS6jVHfkBPrVggnWy1sF3gw\npqn5xX2Me7gEIGDjvMAyaKVYGYN/v+S7MyGhmEEDMtUnZeKlsfLrxh9UK6fE\nVJD4hiUE4kMg6SjSAMpNfdM0C3S35b/TldDHHxpHCCLwTJdvxF9HiNFsYvsa\nBXox/tKd22TLYAkdx4KBCOxYpdiK1ApSmGXZPaqkKc/D2+5ytlbSRl2/aqa0\nELmd\r\n=J0y2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e0d6ae67c25cc01ffcd98d3b4f2b5aaac7f5c3fe","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.19.0/node@v12.14.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.843"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.843_1579344519292_0.9727185747148877","host":"s3://npm-registry-packages"}},"0.9.4":{"name":"piral-pwa","version":"0.9.4","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2918a599ce6fb7b0051d96eaf859610e665e7d2b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.4.tgz","fileCount":26,"integrity":"sha512-Ava8r4GiCStXfq6cca9f47Bym5g6oFPJ8HvUnpRe3jkYe7DwOC6pnHGK3EoRAFAS3zsQKL2RJYSU9c4i7SJc4w==","signatures":[{"sig":"MEUCIQCB8+eiIGupG3VsWqaOrSIWAZRvSCO8cq5gB+SZ/dhb4wIgQkq1WsUcyJO7fDpZjHgtIqVhZOkGwt9WHg7xR3hzOuM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJdJSCRA9TVsSAnZWagAABOIP/01xwQgK65/R3cOU9foN\nUarjEFopagWY+V6CNO8dlH0z0QUgqlwUgN3YriBdtNfSYGXuqFqgvFEZEgs6\nO/jdiNcC486S34uk7efDVU9GyeR9y0K0eVwOsdQxUktiXiIuc87f+3VtYzsI\nFEibZntm2BVOyNZZSpd52v/cayoMQSuSNqu+wkeRQfhJUyRCKEf7stakL/Am\nwOsZ8pTDHnJS8qaCGwcZZ2XXCgIUqqQElYlHG3pa5HfhDTNXDqYq/ipPKNB+\nzjOe9XKi1pXkZxpbGUxpOUX3LjW0YToJQCMiFbY0aW7DVc73j6QE69JqtSL0\nSsZfxc63iTAm+qermi90MINjV7g6vXZSks5hIJkGy++/2UNcP6nX6irqCvJg\njmOEGOKwC5mVi3EkzW7yUW7pQ5TlCcBn5hKVOw1vdmRZq9bv2sFn+pEgU6ou\nEcfo+gM9Bp9IDgzykCKcQDlDTm9iciDi+PZzwLiOpPYxxoShTZac+s7wS2Bz\nRxxSoM/BwyptKk3fJJ+ZOIkKQLh2Caa2eHeh7Da394RwNDWURQ36qAamwlZz\nGO1UBUrjmmGq4iUEwtm6lBifBmKkevj8tX7uCMmE9ShTrCEbcGLqpMTVn9Cr\nl0s+ysztTr/MnrdjuGWboGEbTFjDFd3ZrDSqn/uHPmNV8xzw30K4G1uFHKhe\n2hcj\r\n=zaH1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"2426a2466d490035811e382e871f1a019eae3513","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.4"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.4_1579536977859_0.17962001148612705","host":"s3://npm-registry-packages"}},"0.10.0-pre.846":{"name":"piral-pwa","version":"0.10.0-pre.846","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.846","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"dea61469ef54a80c993f6a719d93865e15fa56da","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.846.tgz","fileCount":20,"integrity":"sha512-uUG4mf4Q49xC69CDktNb3hU9HBY+97WysFpWcjarGEeFspe/U5U1sAXTCoLa1QK6Ga6p6hCf2tCnyo+yihglww==","signatures":[{"sig":"MEYCIQC+o0eypYxWwJJVMZ08r3JFKSw+nFISOePx2rzyDJswZAIhAOkt2Cr8zuqoOhNaljMdKVrNVZ8Qml9doErPE55jGbFW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJfGOCRA9TVsSAnZWagAAHq8P/RDvLHPfGooXmZpgD0Jq\nHION97A10Xete9kPFhORfDAf4b7id9rmlrHyU6fqn7wcjV+rVBAtmqhWP/jj\ntIxaO4+t27eDPJMIzOTwP9O9ycXqDDxa0A1CfQ14ckCsRuLng+CAvn4val5D\nYW/bGFuf9Wx+Eu/7gTQ+ceuN6a0s/DT5ZofuFTvVDPPKM5K+cN5F2Q4AGKmw\nbWp6qT72unD5kqNTrEcKaLs4SPuZFiS8gBRm0yhQPRemeloghq7kdw+ljE/h\nW8h3hG0hv7vFsLFpp0tgYfJ+r/8muj/OI1ggsJHJGSLBfOi6fa17Ht++YXW/\ny6cKjaCyuOVQ+x9k7ymGWzQ+GniSv3xK40ne/8A5PlW2z8R3LGRXD6EqpcRb\naa1d/6WmQa7yogno1VchhKcMDT7AZWI5lAhPpmjxB9QCHddIzDLMDw0ly3I7\nFdtUjPHH01fv1Vx1GwSvLS5snCNTBn/uBXJrwwi6i0uqyHXPaOzuE2ibSgKW\njrRWBbqWg21ogq2MKXkltKodcCj6RTc7pbGA6LcJbl7T/BwPWiyaJj/fF/vy\nQgwUmbuS6RBawWsrgAS4UQO8Hxht2QWdkOSBBCgo3f2rhneh3C2tLF46ejiH\nX3iUsB1we+7hA/DeiFysTjxwqxgTaR0HQLg9BTq+kxgsEwFeCpdvgavrWapa\nSs6A\r\n=sKs3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Setup and Bootstrapping\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bf161f59f5b0b218f7443a4cf61534edd2aef929","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.846"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.846_1579544973875_0.5944558010350476","host":"s3://npm-registry-packages"}},"0.9.5":{"name":"piral-pwa","version":"0.9.5","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f4211f16f52faef442e8b35093349104952a43ab","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.5.tgz","fileCount":26,"integrity":"sha512-pT9L2hYKzyzwJOfcsx5lqkxZtiP3FhHH+JjkcsITQDKyJ1zKwr3DLOjA5GMjCWTQKNPd7ANGFPIf0C6G/mDGIQ==","signatures":[{"sig":"MEYCIQD0g2DGJ3g5Sr4An16HSuDr9+W9Xs1AVTjH4Q/aO2rFpgIhANxs6WwfqJSQ2We8uGtrp37xtN/XS0UNLkMisAp9vnRp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJyk/CRA9TVsSAnZWagAAwmMP/3BoeQGpUkZuQfAtVxGE\nCcIYzVpntppu3oMVTdj+dwU6vdxX9bGz0EQhpFKbjUN9QNPZR/PAP0fIGaiz\nFvTbVXlBBN5JIsyHjUp6FU7P5UIdjSoS/Ojf1b256vAIeW6d8HUZvRtvREVn\nYdfv1M6aEkL0KMvlLZnzBprmdjd+4HI2mCxSnfcqZT04Xez+fNnReQDKxfSJ\nJChLWMLITY9UmJ70aDuBFrRyMfZ8BtCeSjVcLgNp5Flv+YH150GWusJx3meb\nmlb/CcslbGntR9pj4rSu/B/CG4fmqwm2tVT2Klts6mdcLTOAfrHl4eOD0l1l\nqHQkcBEtC3tkf9c/swCA6na6/zFuJoB61Asg6wqADGH6Jpm+FJZ5LhQSa7CG\nYqtvGhT3vUeECs/CeXIfJqm3FuDoIwA9S0h0y9I8PCEQBlTF/CjtGKnZOwhQ\ndJDpcYGiqUNhFN/uUx/egraA3vf3sp0l6zDNVDnpeEFZeJURDZqGbZzqk7pu\nRFB2MsoTdK1K1Uga4qzBbsvsFk1kTlPY2PY6KkxaM/+ToxNqnCtZ8WHYYgZn\nbCEEXWZnV7J30I34RG0rrebWO9qY0tWJSDU9cDwRF6SyzAI6NuaSxrG5zEAY\npRXkstggUhBWu19DMlCL9f8Wo5IZRKSFVZozuocYWPOpEsQQGBpkBChIgCMS\nE+eD\r\n=YvO0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"1157b1851f65feec8001fcca9307f612328266f3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.5"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.5_1579624767290_0.9154209541533824","host":"s3://npm-registry-packages"}},"0.9.6":{"name":"piral-pwa","version":"0.9.6","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d41c6e2678a123129dcc4670b5d989a0f1ce0bae","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.6.tgz","fileCount":26,"integrity":"sha512-SmeXrJodK7ir3iDgm9xtOo5wwL7cLYnLS0nWjpWV4s4PMyur7iTJrcV4fUeVT8ipape/IWppo2y3n8fmL2RwUw==","signatures":[{"sig":"MEQCIGFmrX19yOpzuNGdC1wr80F8KZkwL7v/UwXSL3eJuvuFAiANG4e5kSPt1hQ9doPJD1D1NycwP5bYNQ3ezrbi/9cOUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKHmvCRA9TVsSAnZWagAABnQP/3nC9njBCOaT2WnFz5f5\n+aEFySCwlDi4lN0VAuDt2sKTxDu+aLeXaSQqmuNx+aCx09oKJY6sESzZhAeN\nQEhUViSusu3X9b/huJLpoz94YRqcbVcqq0uXpGmSEotac9l8hMEzT0KrmzsB\nIVN2w86n2UCy4DFB5UAC1ka54JMd4udXw5W3sqy1lrBgBhxUaepRFC7UQDw0\nkQT+gVDWgXt+aEgnD/9RzOdJRuddTg0rx4NXhlV6RFU4F7TzXDALvJWgP6Ru\nR7ZZ33ti5aVxDnZ3Sw/RskeBCiPcg9/fCS3iWqzOYcZelQ3Xt4FzadWJoNly\nTLkOt1qiO0RT5azGj9LXAsa09HMOT6Iv4lMR9VILvJFsom/m82dZOeS6TUFh\nRge3/CbBU5Sfg+TDL622LGVxUU0JvWLQVbKlvK90cEbzZUU6RV9MBsUJ6str\nrOqLnPCP3n1DujItdQbx/djp/+m6bVn2W2tQYDvJj/LiL9gofW2/dVzdXTfb\n5DRuFAIkrOx6X86YpPj7RjM3ClllVERdDwNLHVgR69jKY/1+ZuEvEVvYj2Tq\ngR+CmNeLMjWospDk2bv645arfdgUTnaAz/67oeqcY67SIKVyEu4v+5h9JoSq\nWBS+hxcNxl7J6VM1pOncyaQRLDnIJ+eSKvg3mFLYGiQbY50Gvke6H6VX4obc\nmJFu\r\n=X1U8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"fca193d792b4d49b5f8090415a8c7a90d88bfdfa","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.6"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.6_1579710894709_0.5505980245762101","host":"s3://npm-registry-packages"}},"0.10.0-pre.853":{"name":"piral-pwa","version":"0.10.0-pre.853","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.853","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7d801b02bd4b02b4784d2eacbdf6eab590b6d6ac","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.853.tgz","fileCount":20,"integrity":"sha512-DIcvxztMcw6FDAA12HW7mLmaYBM4oyCeSfDK1qjmSjUZWwV+fJHH2lELSwOn6U/HoxpSgcCjIfm45qkeCLP/BQ==","signatures":[{"sig":"MEQCIDcJ6NOoTMuDxBYv8QRtPIsrUecJNLGkpWS28cFunaHPAiAtDH9TpNWA70k1IW64yvzCwEwY9LnifqNxSb8xC/F5LA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKOhtCRA9TVsSAnZWagAAQZsP/jh0vLwDTFNDOuPGnKiE\nDNInsDB4i/I0BPfItk9417mjDsgf+8uszZEZtNg0E4WPbNWP6Fu23SXXcl82\nDWb1SQCavKPYqvZ6nWBXUWSoTcPYMJBsV4gaWGZMVkV4ggcb54YYt9w361NQ\n6n4loPUmtd76eQ6leXjpBSqPh5IdtNIbpzO2mv7mmOqSccZtzyihc3qOcuqy\nEXYvl9pSGtir+NpNsBsdgdzKP1PBp8/tIURTXjJm3odNby7x9S7NWavmaynC\nPKFNgo4GNabW3Ywd5/fimGt1NMiNTQZ+LQBvPxdE02Zvcn6r0IccNiUNW0+1\n6hy8win3RizAnx8y2u1SwOq5s6lno+PucVWs7YasrBFTnVJfh9iMR3le9oMO\nSTiRBtD//hGyEQyUPpBAJmmtt/h8Peuybrq0J/Xc6QCJWNVwqbE6bktWeyH3\nwjqUizKuEKgaDgA/JMGzByhjVmu6nl6p/MpyPCXhWtjsCTUmnOa67TOPYLWh\ninIutlsbT6EcbeadItHabOI7HD6W/NMcdTfaTbK45U/2TmrujQje9HwVGpB+\nDKxlnFtCIU6q1qYaYrKU8R4JRrqI92qOcOc+VkdkM2RE6wi4GUPQOp8Ot+Hl\nbh6+aqcxXy3KhHKKlPOYWdEIUi+25Ubpowu6mQjEjvllxuR5Mj9Bu4zT3lVg\n2C+n\r\n=CAGR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"840155ef91a8f43f65ded5e18985ad25074bdc63","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.853"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.853_1579739244777_0.26827414535285965","host":"s3://npm-registry-packages"}},"0.10.0-pre.855":{"name":"piral-pwa","version":"0.10.0-pre.855","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.855","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3352e3a2bc2dfe5252e6946a374ccef77bf0334f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.855.tgz","fileCount":20,"integrity":"sha512-NpqKOYnokcnpRgzUYxkzuHFfCmWeP8J5EMVN9nZbuQx8YIY2LOBGb/RfROHFfiLbqX4ZpR/LNERU7SPyKKTjVQ==","signatures":[{"sig":"MEUCIEhVaDFA3fXw3KG96R4pf+8qArgQ20HEjq+l0PheuPn+AiEAlS1wzExJygtIvkWn9fI+seIUgDZ0FrUBGWSdE6+KZ54=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKjfMCRA9TVsSAnZWagAAjJ8P/jHhXsxl0zMjr0LlTcAB\nfL+854ZMxuTBZGjlS9mHoCHhN8aomkRvLE74NChsaPoHQ1s8K0P2Dki1Utbt\nMF6y4+T2YqQBArkA8cz8kC1uQpamoaAy8d+UVdD+TnEsZzYRcQZbXiDH6TVj\nne9SWqzbf5uL5TIweEwo11aHbIsVmVxSp9KaM/G/xWXtgH4F/2zsz7R+JCyS\nuPiLy11HmHuJNGz7kFYxWKBZ9nhE4BOF9j1TLStB7WmWeGqZRlPixmpxuh7N\nY9xKrMy7kkHwayhEYHySgdnQxMnRk2+rBRkMBlKhYOEsZwvsys2JP/0tHoV/\nS8b4bs+AiHgX5OWVlexcZZTn23OvS6XmN11GLhTvAw9IRz+P2ibdEPAnnwDI\n9bR046Xv3G5LMGNWozWqDZL6fwphXaL964KWkaq67RdMB6DKF1t663oElEL6\n43B6XG1nHEmK/XdJc7t+aIOus0ujRu2D254nMIbPJ4O0n1bw2tdL8IfzTtpr\nHFClbZXCVK3b/sgXIBMEe7HtqfnTYmj2Az+QQNhhlDNPwAyDiFLi0dGAOihC\nFdJRnLvuughQnB5d83WEtb15kOdF8WmB1U2P2S/hpcKDfohZURnlZhuxvfAr\nQ6w7/D2Vo+FSaLjE9g5tmHGYLSvSxHtE7kSETwpcOEm3opsbML+jUUS0jUfQ\n0U7M\r\n=JL6c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5f1c30798e884881ced198bcd799c9e4dd084d47","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.855"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.855_1579825100369_0.6039131033357372","host":"s3://npm-registry-packages"}},"0.10.0-pre.856":{"name":"piral-pwa","version":"0.10.0-pre.856","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.856","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ae301c0fb15da73139f9b483e179edebf6c29e7d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.856.tgz","fileCount":25,"integrity":"sha512-h/P+O2pXj5oeMIV0slJCYBskx2+0szedkzfyGWGPDvVYMkoMSPJ/y1+UUvmon2Uy2MpZQs7zo3FzwsE3g3DBLg==","signatures":[{"sig":"MEQCIDhxtfi1ClM2pll+N5vVz2cAYOFimditvu/KG31PADFcAiAb/+PlkRJEa/cwbjzImoItr+GmL77RQCbIW86beinyJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKvE3CRA9TVsSAnZWagAAgJQP+QDsPwHt+WL4sp53PC22\nyDkTrOpJw+deBJ9d2ljswwU7UAEtbANd05PvH9yKy+LH4mJ8s0m2ZvVPglYZ\nXEZHUECXhCFLzx4ohlNg5DmnQPg24wPK2SJC3G72oTWz2BQIY9VRzHQfiawS\nzqEpAtJIFYM0uZa5GODpfZhhhZE2AAq9zVb9NVA6bOBBDUQWPrRwVkE6i3VR\nrkMiJGbhw9QX0d0glo2xxJZnxqRbAp3Q98CNyaaxWLoMoBkMCkVbOQcZUmSe\nKG366CJhv/GFBqnihkXawOB/bz6DEuGe5LFt2ux+yBH3rbMB2zlEFQDs2ESR\nmfOvH6DqViaRAisa1+ublwIK3NMU6h29HjGscV5aozghcvQoy1ab/DFwd87Q\nY0IP0R0AcbKgyFfyFbc9a9tZWJ4TG8EZWSEqccaRpEYH9th6EkUkUUMr88l5\nULa0ghGkkpDqh8obkpjP+0JXROoMmjh8XfO+vuc+Esr2gbXAKz7dH5L5c3V2\nuuBsDUz0n8jcizVLPJX9YnXlXLAI2g/uRFEt87ys+heAyJI3oZ38/UxgRyKK\n4RL9/ODGLyXWUgI3r3E4RzSlXBEaWVm80eCr4kNTTdA9HWOEi31xtnR7E+xr\nRs/qxrFTTog+S8k8U/pkSTQrEGKUrNLu77kz6lyw9TQik9LlH26wsrnvRlQB\n5yDw\r\n=1pVh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a886f74310f8d4eb6cb10bb665e994594164b666","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.856"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.856_1579872566646_0.25827541130537957","host":"s3://npm-registry-packages"}},"0.9.7":{"name":"piral-pwa","version":"0.9.7","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9b8d9ad28da7d13bf3f0d4604e0622a912c7fc2f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.7.tgz","fileCount":26,"integrity":"sha512-iR8o/g24FXIqhdjcnFlREmIzAGScNt2SZZYThnrtSyy8Ovb45qWoihjR/lnTBjc5fmdV8j3Qc2+BGXIQpuykUg==","signatures":[{"sig":"MEUCIEaeH4HcVqetZyPj3/9cvkAZzzdGrsZP6Wg9vM3sbfAEAiEAzQFUEyJmnE47hnidJzR2ryz8THP4Rge2hq99vPLDDC0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLMlQCRA9TVsSAnZWagAAveAQAJ9GF5CJ9d87PagtIYbw\nQWi1mOhkQPP/84LjCqVpSx/IN7CSRG7fdCVas9rEIZCZp6lYUKV5w+yibRYn\nds933Mj9N6ar0ywvOEZVl0hixHmehAv5gfFZAqU4xii3YxMjsyD+QbJAJR0a\n9Lx3OeDCtjAhYKpQWGfJKn8hkQ/eO0KnsUtbAaXq9LJiMn+tE6CMCwtHMKQ/\nrS3gv7ICL0GGYCCzP2Q7eSZAM6YQXw1Z4GAm/dcwhl1C8sjsqfnrDID1EnEw\n9XVThaUcDleUK5ZWxCiZZTKkzFc8ULdQAT7m6V30rJ2YZOueXED+uD7wu8kL\nH1Ow/56aL3rqlWei8e8Zd7HcgnLqwY19dWizDEYwzcI0/URop6uAw9WBeUCC\nLuJozbiv4oJitPmLKOFPMAhTE9jE9Jr1dZOUNBNKnTx86AMTJsk8ErCAVjQM\nFtghi+v3eN3cJ3xGdI8hD03tuJxnXIY/bfqikoM1L9RxO2hG0VpxrgH8oQEJ\nHGTAyIF8booDJWN2j9amgFB43W7aqnjNfT43Pr2r3Od30KvW8ah9L0aSLlLv\nQniBc1BqF0U5YIpiPidfMJp/7oQMshsqJL0QkKnoZSmbqlH+reB1Of4c0dae\ndGOePBKvTfs4Lj3hWe915Wf162ELSoPPF/jHV9r11cMNnOiP334kjf2IkSib\nlrEf\r\n=AZGs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"c4d1a6be5e020e5031fdf43392a48c341540104b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.7"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.7_1579993424315_0.35240581605582144","host":"s3://npm-registry-packages"}},"0.10.0-pre.861":{"name":"piral-pwa","version":"0.10.0-pre.861","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.861","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3e656f99e9a7d3e3aa85d0ae643b9253018b883d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.861.tgz","fileCount":25,"integrity":"sha512-aOUS7ZTemkfTq+VxHM9EgLkHTlz+rw4UOYGlCV04iCp2QSDcmeblduuqqwoQn2dshn7UwwarSV6dTX/nQhvAPg==","signatures":[{"sig":"MEUCIQCfBwCP7oxBJe9Kij6VROb0TUn774IPcW3sl0nQ7mCGzgIgUZwA9kefqaD7WwiEDhJ6FW7rjo1R6zBBW37VIlv5p68=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLNGDCRA9TVsSAnZWagAAGmYP/3X6hFHYUu0RrD97aWOc\nWi+HPzeQUyyjEEV9eNjXfhhpFiaQ+bECF9BqSi+N7nJPvKbjDabpdngj8JPU\nsxtIALltQJdon/SB30CeqyIY++NGT5mPJql38kaK2J+9IaVeSp20WoHHCN/E\nIr5o/EW+VD9n/6jh/7i236+/STCjKjNyW3g8REMW1T/rsALGf80KJ0Rt52kf\njH55YewrcXXPLNr2n77IAiUq+l9zIA2jjPFx/GJrvvclm85Nu9oQUWcgb861\nIy8w+CDaReiK0N5DiFu4xxCeMjBefzDWhNI6VuddvECo5DN3cZBg508OaJPa\nyNY23zSnRGJuT5LpMThTrBuZC6yEyF0RzqN8R7mfWsclnBI7iBLNnH0/t030\nXV355aNghaln7HVw5JmbB7ICezztzy0apSdT1rbeKc2HK3u5rE5+D+PQMMFj\nv4eW2S3CtmjTElIBIW/g1X6rlL8MhZS+9ghu3spSTM1fa/74fUQ0rhP0rUaV\n/cbMn7c3RJwF1TI6MRaCUTTDeJ89p2Vanqt5rzcQvh2eXKWx8Ftdb7/z/QP2\nBwp3xfG+j7LjB31nksWDwbRQPNgu5cVjTZCDfasM5c+mupPXb4bLN50Vgqye\noola922v4WFANpjI0i7zA2b+4fZwiGEhzmVGsXhALiSgWn6K55B9Qa/HNbJT\n1g95\r\n=7SB9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"572c61695cf3c9fd99a815889061c0c40b0cdc31","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.861"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.861_1579995523454_0.0913101631437212","host":"s3://npm-registry-packages"}},"0.10.0-pre.865":{"name":"piral-pwa","version":"0.10.0-pre.865","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.865","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4c80496dc91113f2e3954d9af16792a8af1bd8ab","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.865.tgz","fileCount":25,"integrity":"sha512-oYIYnqEJtaBwx6QY+ButDoOGX3IyH4Zk7zzEsugHRXsAvPwj+f22sH+RLyS55C85BTdvNACIUlxIuV+xue7QtA==","signatures":[{"sig":"MEUCIQCzkSpwg233O8IM26hy8h8fVnSbDshcHciGIagppi/FKwIgecGEWCa7H/n8OxR/Ufr7LeO/DTWPogr2WNXTajNMuh0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLxH/CRA9TVsSAnZWagAAHgMQAJWIHIois6n1Uhsk6mia\nTBLeg06zgXi1n3UC+dLl6Ijmf/0NgnypP+Xham4n5ETNP/Ng91w8B/HhSpwG\ndoRnaTe7cYyPBMsqQfxmLkCZA23+oYGUAkCCC2lOxeTcA7r9aYzh6ixN4aj0\nkFCk3V54X+pVDXADFVlPr1bzDvtZbto2dUKXS6QZkw13fzlqFbSpWgCNRV5I\nMoCgF4vd7VV/xIj2RWG0jLGjfnAUYE1dC4bjtyNOOfbstvCHJ/0TfsTL6MvJ\ndFbSUDYFUciMaGg49CaIek1b9mBOBVLSR5dwOvIJI4onzKGfhZXisiLjztDo\nWOQPWL61V3mVo933NFkEFLbhRST2u94+uDgB/dX05q2HOqZ80rsO+z7qiLNm\nyOu9wP58YpsKWtLEffy/p2bgwlLEqnhjUrlfDuBcyXFC/hZFYJYDSXr5lL5J\n5g0nC3ChrLuwxkWrzCzZrGn2eDHC6opz+1nwAFKEewXqFXJvSHxfTY0o3WL/\nMj35T2Qu+xtkpAJm4Kz2G1yup/cZexQ0WeJRTifE+kJ32cvvbTceepOKumnz\nS2bbVhDjlKpw1c5JKana7FQeWiBE36U54GKWymWFuVO1vRttl+3V6+jdnNZk\nKndTM2cmlz+bap0aAesPHXUqNjE4PVNm+YqW5NgamC/zr1QwkWv7kHNuiwyk\nBxCd\r\n=27kC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8b61ba295ee24b9d5615528dd3e6f300b9186102","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.865"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.865_1580143102742_0.7387314931236086","host":"s3://npm-registry-packages"}},"0.9.8":{"name":"piral-pwa","version":"0.9.8","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6f856e894ed9832413447331ac84391d797c325c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.8.tgz","fileCount":26,"integrity":"sha512-U8GXW942wPCoOOt+UekPSKm2ncAylmeLtC9G0o1WNvtdozKpsAs/lSRVG/OdZmSitXO1mmTh23tn3/rTeVwcrA==","signatures":[{"sig":"MEYCIQCcjZ9qr5uo5ouNYlqHxYBgxB+dOxPFKj69rkf8w8LqiwIhAOJZnMP/ytFNTzh7kljQeqenqd5whZdlzN1DnHAyFAc2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL2R6CRA9TVsSAnZWagAASYsP/2kX1HVuuxcEujzgj5dG\nyAlIIy1fgrCjX2jg1Y4bo0SFPsNe5xBrh5hfuZAX4DXUCPyVKMyu6VeLFRg0\nhmUnNYw77kfo/ACFh5X4G7McwOdOUdjMpmt3bRccXXfFQrphlXFK9eCKoDLd\nQ7giY2ZR2YJ8sh3xiMagyCjSknwd60pw+HKPkT2rSVBBcRyIdSy1dO940kp7\nnTcxwMGwdXbgW3FFGH5uShi49dSs9CElHkAwFdIzTOu1PId9z4qP8nwtXZgn\n8Hti0TNRgVkZvtSiNw9O5t/DQPPdNCG+k5RG/YtPYs1eSLCGBzmPV3K7Af4d\nL1Jlcr20a4dcDBsRHG7Aia8fyM2x235jmsPg02CvqB2+RrqdqCnwag6ffCBg\ndEH/U8Q3zQyhpqytOWf5eJNzpQGjC8qqbctoYg11+gXyV7cpNWuqBac/sCZh\nFoGZ/9dVrgNA+XJWtzAYFCGjRMro7YwfNItBhCSDGOit9vq4GEvGzIPdYYlx\n4TLwRBMRuvYIJWyTlfjUwwesfZO512MKscFtZhRkZcMVzwaverLRmmsdG+Ho\nNb5Yv3zNWivi3+q9lwgjDFxeCRUnOeEUetWHxvbW3mgot5rvfSOIh8ER/k5F\nTAMXAgGR4T8FDe2mnEDt/6iFdc3FC/zNk1jGlix4aXB0xN/6DfM3qHRnt7ny\njqSE\r\n=0jWR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"0dba7e38487b43dbd350fb623f51c4449030e1ba","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.8"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.8_1580164217916_0.04440603142732402","host":"s3://npm-registry-packages"}},"0.10.0-pre.870":{"name":"piral-pwa","version":"0.10.0-pre.870","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.870","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"819b4963f27f67212d29cdb6b60060ebb8d49f42","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.870.tgz","fileCount":25,"integrity":"sha512-zTbF+6tqa0E76SxhdaSVWtZHeNw/ExSWldqqnuK8sR3UyiFCYNSd21hzQIbNLo/109Ei1sRexw6RCRWy7hS3jQ==","signatures":[{"sig":"MEYCIQDEGPT4RDOQ44+P7308l4xKLr+iT7U1tb/ME8b7PYEp8QIhAN/At5000yoDa5o2lrUe7Qf/lozVLEmCic3TaRcDxYe3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL2xmCRA9TVsSAnZWagAAFJYQAKBHajr+uS2Q7euUZopt\nWocFIijuSz/DjtD1v7T/5k+X7lZseETvZyCt44t4uNBiGwCS1eR39UEthZJ2\n0LGRLxlU/Fqb0kBR0BXwmY/gGcbx0OyrdcGvGkQcId7zaGXC36FNXNVMDXA3\nP+Uzu8j5iF5Lf1iPe/qN+TN99FAEXuzbv5rjXf0Zf43GsmQ4j73cUAfvYrEy\nrBa8EP4LhI24GG8wzk5CKr3bPrh2dheM/Z10HLniWn58lXOcDsPKdsKB6gFd\nqaPovt+G1oe0olsvFSoExW/0qIPeaDDS7ATHw5wnFY+rY0iIRcyf14/4m0yA\nf9m9GwWcyXwPu8fus+/wTymEJdaWg1tcRJt3oyNbX2zLrbYsBFaqAo0o/TTq\nB9qRmleUOsk11zlmnoPd2gLSlOHUdw+SyTbNHEZGyNYQJW8NW1OZ+9pvQ5+a\nLehqK4RJhwzBf4cOnikglHggUCczksDKhw+z1CdCrj4Bem081LzGntO60Qe4\nXv35dsX1kdp7+K+BrTpQMvFNt+kYwJXVoNOmocvY2XBfUtS+ndQMaetAe0ce\nz1JTJY+pYOdc9k+RS+w+xel5O8FmSz5fXwrPZWKKVGyi4o6rI3DvR1ik4ojn\nS3mVlvdvjuoNctrayoBrOemAINZy+yUxQW6lAVLdat3Q2PkhXUF+sijDuXGT\nxqh0\r\n=5XKe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3f5e9436fc72c2a007c9eaaabca013d0c5288f62","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.870"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.870_1580166245881_0.7673874590356309","host":"s3://npm-registry-packages"}},"0.9.9":{"name":"piral-pwa","version":"0.9.9","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.9.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ea7607dfe4a036be6bd84204ba4729f75166fc39","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.9.9.tgz","fileCount":26,"integrity":"sha512-OQ+ymQiBbHqAWGst34UV4mH6VGaeJcAEoyQk3CQuF7BtDyk/w7hMgy+lxMLharikliRIHg7UtE1mqeOBZtf7uw==","signatures":[{"sig":"MEUCIQDSIBXaizmxBex2hRKAcf809TIejvUlMve+zxMkRvpjOwIgIw3zAYKNRdTejW9428n53J+JSFCC8NZ+5Co/glggnIM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMY3PCRA9TVsSAnZWagAAwKIP/2jM/hc9aQaVcV9vrNFb\nWTrZFX/HSZqKYVrNSpbXavcNJQhZuT12y1V/rJvlaubabkzc/t4ZIR400rbn\nvaTS0VvbNdHhvKAg+xhXc2wXBjJnwIELpiJL1SrheJ0pFH9GH+ZNRKtDaw/s\n5jOMWXn7eDKwOzBOqg4aWEtUB302F0uU9dMdAjLM3LebmzHnj+1hg70Lw/Mq\ntetjtXrxaWJWcnIPS2oB8XB9T4T5hdEns0wFCEVp0gP7joSJGJ6005caC05P\nB/vvxIq7eJYwLyh8Ed8YJeQnUXccBsFnP2qTtyTg1F2cdSkGkiUFH7i/YBJ2\n1dwg7eGwcnqc/7KzNw4v3E0P0HZht/GZufYZ0uGdaqJILNAOEdrvN+J7vu3y\naV2SIJB0RQBF9RiZTYUTK+1iFHl75wCNH9hlfsnbnPhSQU+quQgf9R5AHsDY\nAltrbF+XTAsfI1aAQc7AFGtYhNqnwm4HS21qOQOJPqu6/U6tVsqarH1QCNRd\nVJ8o9apfvMWVYLL5vN8+3aD0GL0aEOc9P6O5bBp1ZBCiA3GxU18scy9G9AD3\nR0X1+43qRj8hevQ9GufxLvZF3kVxF8fliDCIHWv3RSvIw6KKpswxn1XxSmGb\nlHSouJoP0l9ny85htxGnpQHotYAzbnU3anfJK9X/GMiV9U5VN4zc7NiAfoXS\nZa8t\r\n=SWTG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"07a4d59c9833cfc98b1f086b54abfbf3d65d8282","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.9.9"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.9.9_1580305871040_0.2269435375741331","host":"s3://npm-registry-packages"}},"0.10.0-pre.877":{"name":"piral-pwa","version":"0.10.0-pre.877","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.877","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0320c4868ff9198368aafc596f6863a0a647d70a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.877.tgz","fileCount":25,"integrity":"sha512-bd33l1sLjtbeQ4bYyEvaJzUchZQaq6U+LG8WrZn595wsQkw8M2fQMq8bCncbxjKjVYZMn/FLCC5OJjc0bT3zrQ==","signatures":[{"sig":"MEQCIGaiG3sNz+VKv53wTH0L3dsuRFJiea7/GuW9AU+I0wHTAiBMn1sXrzwnDKDDaDDGG35dFhn645OgbTJXNjSDHgTXkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMwMsCRA9TVsSAnZWagAAmmgQAJ8eyoW6mYpqSTZJ/wEf\nRPTzidpJqnKvdiK0paLEf8COrRzZZhhqGspO2DPnkPUJzocUCvtOd+rRrXIa\ns0xcdBOF+ALNBVD7sIlNUVSaz5l7mK6yOuXfUZ/OCjx5esLSyfonmmuSFAxq\ntER0KMFELbvT8TQl2Mim+sA5hGaSeM3FVdTzFOnxu8zUaqeWvd+PqdThN2ig\nWlaupDyDU96GNHHk5qrHGE65RE52TA3nRLL4Ssf886sH6afjSRGrWgPfzh2u\ngs96POQRJjcpc975VYVV6aUdbcEmq3Kw5/dG4xOGHKDb4lVx8TQQzvyB2TeF\nzx/diwrdGMMt1/857H/zB350Z35T3HvJfihkvnboODVD+lBPPjFl5bhTiOkn\n9u/Wbw+vbMyobZP4niZc2VqwAdIbxsurkfzHKobZmd0JT7xC8jMPSoyxp0e/\nOoW57AJnEKWFOcL8Nn+kl7/ETL6zhYkDUNZIQWebGGnAOxHRB1kpvuDunp26\nTO5TdSdP9VLODOVYcuFjypy17goZ24LFXBl8z8yXYAx37jtD9dVFKBwZGGIG\n9P1vQJ6Ok08Zdwf34eeh4s/luLwGaI9rSDKCwyhhOWPBEtDRitIhN+WIGaJv\nEuktWpIR2mzdshWPME3Bq7khh1wX8EzD1E1evGbnQJc88bonLAjO0XRr63Jc\nwALp\r\n=0D1K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bf1caa3f88f10651f9193c685c7dfd404ff31868","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.877"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.877_1580401452461_0.8722891625592111","host":"s3://npm-registry-packages"}},"0.10.0-pre.878":{"name":"piral-pwa","version":"0.10.0-pre.878","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.878","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"eda4bbbb18bc9835f54319afecb448f0280d43e8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.878.tgz","fileCount":25,"integrity":"sha512-9QgVii9JrIZDRNT7DnG1RWOYjoQTYYxn7mJ1HLyrV1CgRphxU58vuFOaZElgy86Aed9bvbd6DS2DpVjVclDmIQ==","signatures":[{"sig":"MEUCIAUVbVAchzBcwK5Gvhg62dLXeOkpDwiniiYDYi+pDcwhAiEAumztC5CsFEH4uAWjAoRonjZvLL9pg/7dYIDbESBs4Fc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMyjJCRA9TVsSAnZWagAAu78QAInKm8/kTYPivSPZc1oA\n9aroeDCuz7MpMWCx2BfE8aLRwiGL544n3AqSPK1TuCn/jK+RsabSxmyOQnna\ncxIgb9gj0jTPAlJANhMOfG18otox6QN0B/NzuMYps7wBHMQ5+p/j+19hGiYr\nn6dvvySJN4DFwkqpsFB87ShffqhUdZRQYiUgJCSVEBVHD1SBziBbZjqj+36b\nVQ0IOoeZ5ia40ZfrK6ZgkOWc/BEA8EhClZLjzNdPHulc2GcZtS+kCnIJ+0Hq\nztVlQ8EbwHUhGdn3B+HnrZsOyw5aWLSO71FlAF0gLhMyvYqs4JJg82Zrm2nV\nTonS2JjfqkK2u6PVk8st+gCV+wP5InQVQinF47trcuAuOFm8mTFe3zN1PZX/\nNxUBbmr5vyjL0+EopDtxoNuofbGObj4wllCFZJjQAgP/aupOJhpICB4gsTrH\n8GtD1eFO+4zjR/zUfSLaiZU/1JdjB1ldjG7j2RjhhkcJD/MvhRCPMIF6gw9x\naCvMQApuBPp9eHc30iSy84l1KVYxiLsUgvfoEYEbJ997LcTxvGrdFKM7juXL\nfbrQUJIQrmrNpL95shtldDv4GuI4NlV+qbhN1rzvG1cVGE61kkCRrWkuaP80\nwZEI4Sliiy5pa5JJ6fGFBORW3jMBoAEPO50wMQtVovcdagNBelRL0iaGwXrP\nA6KT\r\n=AJdR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c7dfbd0aad35eca2b3fea19db8b86ce66859229c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.878"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.878_1580411080710_0.31048963773207716","host":"s3://npm-registry-packages"}},"0.10.0-pre.879":{"name":"piral-pwa","version":"0.10.0-pre.879","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.879","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f9fd1b20bc63c1e4c883f0722428137f44bd6ad7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.879.tgz","fileCount":25,"integrity":"sha512-/NixnEw7L+YmOZ8j8fkHgJ0mQqDIwxM52EAg32cqFHQl90sZx8SllPRyoyT6fvu9cn9b/jbyIP95bm3uyhVh0w==","signatures":[{"sig":"MEQCIEdYPYHE3Ecf+ghPBeHGJHqpmOTloQ+YmzRHXGiKRzUuAiAVRvL9t9kNyAulp2Zq84XEnVn/9pahLBYmXws7jwbkOA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeM2TNCRA9TVsSAnZWagAASOAP/iioljCiik7bdn24oPH2\n3bMgdE4aTvkd6Pzp8mLpzlnxHerorhrEnYJ1OKh2PtWpYRnPG14NLwlthxqu\njjsCWKhVxo7XhSkjID0m2Ea78m/v4ggwko5t3z6glbbcBm0v4NQXFSoJtgmv\nPhRVLjhleh5xdQZeYf+ELQfxDA+8/yj66QKMhESJoewBObRYqQCkE2odJ5p/\n7mqWUsh2rUyKAsX5fhwo/NJfzCPqUKt7lvuy+WTiqz1dqHEM3/I49O85pYET\nLGfQJMvtd58RwczU/7RmDxU0TFDdluaC35zGhH5kr0V3EJCX40ed8GsNGILe\nBrYpLC2GVvanBoAaslZiQzQcvdeIJ/XFzXa/8Sb8hyOPcuMyH34GyTgDCQpj\nfv4hOmmD/OTjnWqDRIETAv7fTQbypCIBytJ6YXanXwODMDIdfhZQOXjjEDd8\nbeiKt9OLNaGM7EN4hWdtkD0D+JHopo6maDPRO21COeKsXBUk0/6QXns/YddL\nosslohY0M1HZMGfNLOOajUkir7LpYx9HgcBuIWBaSlzdwDb+XadOj8T4C2hP\nxfeMi8XO7u6pz5QVp3dLCqcW0gQzsaLOsqhagMPu2I42Xm1wLG3tBaCniD+1\n78HnH/UKW5PKzAH3sMrinwCu8X/0pgustfz4vIhhRE760WE7SDTwsvuMfy09\nz1AB\r\n=1u5e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"db25225fec681aab93e9a10ecd3cc34bae1a2fe7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.879"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.879_1580426444511_0.7186081338848072","host":"s3://npm-registry-packages"}},"0.10.0-pre.880":{"name":"piral-pwa","version":"0.10.0-pre.880","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.880","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4b2e707b3500a3c009126781f4008cf3afc10771","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.880.tgz","fileCount":25,"integrity":"sha512-JXJFApD+j+EbjI8tAI3ls+DifpQls2QqvHeW90UJgeRyxb+Lj0eto1M98JLbS22TlTY+074K7hTDiLu1LEqVyw==","signatures":[{"sig":"MEYCIQCsl24dg93y5Rkb0gz3YSDdzUhgZBk9lJjid0Rw3RsHgAIhANX1SFbHKpE0PfwI+NfmVwon5m+B3Gn0/S5Sn4jionyN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNAj1CRA9TVsSAnZWagAAGawP/2kDCqkY/AvMJWtdkBrJ\ndCwkCNzGDSrZq5rOMsarBPeNcYPSbhDt2CSXRl+mQV46V7GsPJD5wlvHhV0N\nKEG+NWZp18OkZ8bqmAMhmYdTUB0gBte3ibMfoZrzzVVa0UNla3yXLT9WK9uV\nB14XpNm8n4dusLLWuI0QOrwylAvgdXRu+2Vhfr1bLNP9BsEim+fvzpFnqvXl\nDO18aT/e0h6qGsv9q2ACwL/FGKnsbndG4Yb9GVEnXSgLWJo75JitwIfXF9qh\nZ8M0iBLTQgGPw4HytQVasURqRXf56Ref3mRdxqh0DBqOs1b5p4BkfWHWqwYp\nfx6ALlzKh51dYRM8O66gfeos2gSiMV7B3yALlpMV34tOrKBe2ZERPLi3sDFr\nzliC33LLnmar41q5XHOzErXlvzkO7x3z77MAacfE8Bn71eaIvEjiFqBkU9SE\ndV+0oFB4puB9XcIeS8fFxRGspdDE7bG68A4MIR+PrgV4VQ7GhCtvSTImgved\nuk9UVBx0tJ2ttXMAZKMJlS1+MyP5VZ61vkeYBkmb3/5HKOaEKTvOlgny4A6y\niVgR6HZltVuIZKIO+F783Elv9n9TKwJuvrVtnvzvm7GWcMXAnkXBwGpwpkcP\nzmv7VHhZSu1DjipHat8mi4qJK5uZizjrZhgCQ5FTnPWWIiab/lP902n6Wiv3\nC5Ie\r\n=T9JS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"922e2bbb5b1447d848e04ea01076760155381b16","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.880"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.880_1580468468963_0.6942048231333668","host":"s3://npm-registry-packages"}},"0.10.0-pre.881":{"name":"piral-pwa","version":"0.10.0-pre.881","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.881","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f725af8dd1c43826d4dac0e78244240e2175be34","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.881.tgz","fileCount":25,"integrity":"sha512-iwTmhciKr30w8Ty88sGbXF7OXc7bhKOdbun66JL6alVaRwUBUW73K0tjUUM9U5bBhtz6L1gHDt5pxkwaQwoZcA==","signatures":[{"sig":"MEYCIQDXnYat7qnTb6tgJFUqk9mx/PgHc/bKesoQO+NmpalrTwIhAJ6leLmkyIJPkGK84gFdglUJkYyfjUIdMsGnPSLE5u3F","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNFNACRA9TVsSAnZWagAA+kcP/3EB9esHDCHBegu8b5RZ\ngS+DhKT4vWWSRAkb3aCj/hXKRFGSPrBtQ2KRj8/nXhAKMybYlAfSH2no9FJm\nX2gQMCtt5wT36X+twNbckUttZnO5a6zZSiNU35s7MWluzdeHKEiTB06Ce3sq\nU3nou4QadA5jZCdbKF1ciahaCiWHXqxA0x6uqNM0jkWEgHA9TRHjxhzxYmx2\nWV9Epg0BqtyMqeitLXvXotxIizmkGCJO0rzq4md77xHOUU9+YE3eeGgleLSq\ndJUdXB7VMpRRvAPd1DOpyGtOhvu9uzjppuNHR7hG9Q9BrymmzukNwj++r7YE\n2vsL+UzU1pOZJnsK75WB3h94poNQ27/LinY7/7rUfcvw3M5cXGj9zsO/rKai\nr0dfHdeloN1nGtL1fuUrzaJiNfyXBr1ALkRb0v1xVvqHd5aweaFVzCtKmBbV\neqpV9WZhHe6ih7oxHRIG6TkdLCWgCZenN7oXf1zDIIpma5on+y7Wp/ArkDKs\nVWqTiWdN2WBpSFGmrl6bVdEk1yalABXfuDkSsTOG3TTDB9QyqlUtX1bxoo3p\nWCy/i9tUpZB9wf8KEhojyQwsZlGr9EQDl47Ob9Ig4lo+vKS6tnD6kJfn3/6I\nFgTKmxpZc51dpDYQswifrYjBI4C4fu+bToTkcUhppMKx8dNCidWevZS7bewZ\n+/BG\r\n=t/A6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f2b9b15c8bed663db3300ef34de5a9ad02ab4600","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.881"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.881_1580487488107_0.29756915953278873","host":"s3://npm-registry-packages"}},"0.10.0-pre.883":{"name":"piral-pwa","version":"0.10.0-pre.883","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.883","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9d8f651396a424c07261d1336cafba22775450c2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.883.tgz","fileCount":25,"integrity":"sha512-2ORqcN26Kkui366jJQ0KQwxGT0Ttp9+WFtFtmvxYtyXQlZ0Wb7HtvbBxvbNgjy4Vy47t9oqeiCfa3nUxquQYGA==","signatures":[{"sig":"MEUCIQDva8XY/o+pOkcuPsXRFAcvWPQ4hVZu/lfBhEXuNqmw8gIgalZ5XULHgk8iUhSECIWEegDi1dDGtfCuezXK3L7Ytzg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNK3jCRA9TVsSAnZWagAAwsQP/3pvdZn4hY+T4YTu2nu5\nY6+ueY3lPJ048i610QPWXbWXjgJ8TK0K9/baXlrDRAu2IS7wSwyLxHTV3Efz\nOGj34PM9MWiwL+4JykiiGEq9A5DHpyIp3vx5QvsD848S48V30FA3MKAgmt7d\nUroayzoqJvucpD2pbq2wOVs1+uu3X6hIN1NUIntlyW95hQ0JaIrJMlMqszlj\nO44rhwA5GRbqd+zP5neir116Yzx56p/seWncqFGPX5qcddFQlrXKcvxtK5zt\nqGVq21fw4kBLP43OSf6wjnQtWS8jFeX3w5XMnZ+eMbQDR27Xn4r/KevSRh4M\nzNPGciy6YZYcLAIQCNpLiWvxgdTo++vgt96BoBpLUYNXoq6RXmVTeXBYiebY\nuU/k9S6zxqd4VMOqbNIjpJ6RBzRrpUMQRrjJ7RbEKHcdM/1ENcIG2v6qOheo\n8fA5VcUcFNapjtuQVdonlwL1Jv63sPvPLxY/LDjSepL4wELJXz+H5ntptQfA\nm5L3974iRQlgNr2ENTV4oCg88rLAENrOBd5j6SgYkXSI9lOw88+a4wLzA+Nf\nS3al/86/7oO0X0bhGuT6qITO2WUgn7CDm+wUS5Qtn5RpR7YftbvjtvU59QpV\nCbrarHh6gZAHWbqVKdNmqHH0TS98nltBK8BUeI4RfR283TsiGxI84r6OkXdV\nsFI4\r\n=RrC5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4de08c8606e75c113f60db38aa5ab3f15f62b7be","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.883"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.883_1580510690763_0.21720166210028058","host":"s3://npm-registry-packages"}},"0.10.0-pre.885":{"name":"piral-pwa","version":"0.10.0-pre.885","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.885","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"55c324fbb6c009748e249b72004a94536a0cc846","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.885.tgz","fileCount":25,"integrity":"sha512-dMZNKF5ZW8O4EpNq+LYUBlzFk/30bVCmYyLVCHe3jcQZwAizOIsHu/HgGCgfBxKloljr1s5UghqrXRRxUINqlA==","signatures":[{"sig":"MEUCIFB35OXi2RQOgx1HejdO4xIXhO9DbKDrmSp61NXqIhLUAiEAhAb+NdfWXs/UNI5J43roM9Ke6zsTLpoakz4kkvpK9GU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNXuMCRA9TVsSAnZWagAAqQYP/3LG+dSzP2Io/7O2FaG1\nVWitI+p9JWgzal3eGrvLBSBjhAxIufTDetMFTH00fnDF7m7wxu7XZIYOmVnC\nf/iasgDKgTWHdvcUHESrJHJDaf/3Q3iCcAvHGQG6hn2VSNSRineXM2/gVscf\n5bFkCRrE5iNdrtvp+AH08yx7l8ahtNIETeYXwahmTku0ajmt02Mhg+NFmp9L\nd8t7syTWwZ7pHq3H/w4/pHY8qRAB7MUNIPt2QWhLucuGpViZXRu5fuVt3x6t\nhJkbxb2uVkfAnszqXCsrnVIfVquu+zKOht4ROOeuav1SVRBvB2SAZ1HhWcUB\nwIhGzVgk72iBhFNvhro3NxKFzHRZufdD4P8QgKIIjTkr8kU1LDjnV4aUoh+J\njVCouKksxWBYvZVM+am9lMR4HrvVUfYqg96rbHYsanj55cBuBbfn6uL0L86Z\nuhW9wv1+7mikjdb+FhNxbw1DJ62O2keR8qByBh90qJQYsEZynqwyhDCicW+b\nB+u5cqerwShVsDuTRsw10q3AWZwps6WbjhQE4nYigSNHzLuzmWhnoElEWK2U\nKqybfMWPiQXqKhV35BmhphN156jVOT97FHD2VTpZPwAnGAC9p44vtuPa9Srf\nbRqPH8JDquoyj/5k7WlFQT9yJNUOsF/dBCFkT3a2v77ePwHNyqfoCSnpgbAd\nPHZE\r\n=8Urm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"21dd6e46d5478826848c21756a4534b7a1e87ad9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.885"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.885_1580563340152_0.08652323484443492","host":"s3://npm-registry-packages"}},"0.10.0-pre.887":{"name":"piral-pwa","version":"0.10.0-pre.887","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0-pre.887","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1f47d568699ca4d2e9854c5df7052db7597d671f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0-pre.887.tgz","fileCount":25,"integrity":"sha512-ZglQUYD/WwGU6li86hWvL6Z2X7I168r4ozTTA1BLg9Zd6xNj9RVFnPGEgHPMsaeYSbrUgXfAnvCcYkmX+p3sRg==","signatures":[{"sig":"MEUCIQDjYEeyDUn10RET/KdoeLyHCY06uDr67Y6aVgL1gU1h7AIgHiwrfcpjkpEUIUbSwKQUYwP4Hh+1hM6ROAK7k73XPgs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNn2cCRA9TVsSAnZWagAAoEEQAI4EFs2YuZpNIu3Z0/D7\nfcEwRkD9KcbEVXqa1ad2MW3lQ6fJqWDPbpLsbk+pKvsShN6SgJ7J0L5wElvp\n9j9T+1gNHYBVcpvIx0SENPpc26X8FBe4XqYiim4Httea6L2pTl8+jwKFHul3\nwdnnt1Ui/Cx2YeVKZ5v2DM2BQ6m7sF8ekoYgtHWmVrLJoPgg/C2Sm8lez5vC\nSThKRl7mAHZyutaUbbN0uZYMqR62edKA1s64+2SsqlvojlgPU3wb86DOks8p\nRbxrSJ2KAo9NpYB2WP6XRIfYnEr5kfp3qxc5Uo25M+A9OV/oO4kpjFvybn+8\ncajdfYc0SErCBpERjFA5iQgtKRE0Y522dlONsiSzaSrULGaXGdtpVebgJlV9\ncoD+Q6vkSe9pGS6nY3UMhboEG2P+gZmQ29OuTiOX/SP0VQWOMWowbgYerCL5\nhuUO976hMr+a2tRUA8Jwc5K+qMaxUev8mBDb7dS6lInoBARcE3MrIIknwUOX\nFELkgRI6Q2CamIKXwEVuJzL5yN8fVmME00X1eedLxP6039OxxpnoDejXuzZH\nD1tDFvvcaFPou9vzt9p+JqjXoGw2C7Kg0ml/qCCmJgkKESSjKi4TQ5QWbhL+\nsAoDfS4Yv/0qHQhNT6frrFP0v0nEL1qg/3GWx/rXNgtx/nOifxtTv/QJRiu2\n6pDG\r\n=AEGh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a3e3f64790b46519bf28a49e31025cf00fa94fb4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.10.0-pre.887"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0-pre.887_1580629404404_0.48784088159452343","host":"s3://npm-registry-packages"}},"0.10.0":{"name":"piral-pwa","version":"0.10.0","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3b9d793a7de04dba71fccb50aeb1302493f5cf82","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.0.tgz","fileCount":25,"integrity":"sha512-mTc5zPTR/YOkHNMQzMKan66UXxNInPBSzkyZITL40baPc1t1mn3z4z7JK6bvMy2xNmcnajZyhhlh7RZCrDrdGA==","signatures":[{"sig":"MEYCIQCxP5NF0Xt17416HIGEOnLYTOHM3mNEEY+ckAuWEsqctwIhAOjwDUpTyss0P/1p5vXKTBh1dE0scC0LL4VrzrWK5vjF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNqFgCRA9TVsSAnZWagAAmZUP/2t2fs+VgKAVulIcsp4g\nRqVbOAio2A9Jj7UPMnknemExQ6u8gAo9QHn3JCPUont9xkPfZki1GXCLcGPo\n9ozu3K60uYiG4R3S7+7IdokiZ4fqfTsJtdzpKk41qINV9dv+mi4dwqtZBjc3\ne+RIz7ZM1PK9f+3Emfaghi84MK4LX/PyneOOgJVVMnuwhTIqtc6h7kJwDYKx\nVN+d21TLGViOLkMfyDvC0rU9+fOjpFNiM9OoGhRu8vbK0htMp7OC5wRpGquT\nHOIMZrOOLf2E5I1AA0DODdr+FWoHFzuRXhDcXWjejqIgWpgf+e94IvC8sJWq\nWHP6+tdQ7uecTy/AoHvID7dbaohYVKXeTFbw5xtoZC3Iq58VFlTyYJCWa5tz\nC+TzOu4GHhgcgVunmDqz7DtHBo8RezUOt0rkrSrpkDzCTvEwNYQIRQsNCOLh\n3HQYf7HfVcxfvqLcHlne6jw/XFVJ2vplVdhXgeYTSt+eBl5M1br3m6ZC8ojj\nteNRImAibOCK4CHtB8WP3uw4XeZyKuLprniffh7ZRmGxMM+f8fBgsNQhqUTw\nof0T0rrYMcFf8UZlrk7R2TTYdYIWCkbQVWUCe7HuXLHfi5XFFFpckBk55RQm\n5sqJvT8POPzb+hwyePCfhAkhdQfTfK9oNwi44cB15aXbhpjD4e8oq8NHiju6\nPtt9\r\n=mrgI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"7c5a6e46f285d94749c3d9f4778aab8483435d63","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.0"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.0_1580638560546_0.9012074199698499","host":"s3://npm-registry-packages"}},"0.11.0-pre.891":{"name":"piral-pwa","version":"0.11.0-pre.891","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.891","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c6cdc70ae6b108fd14b720c10f41500e30f48820","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.891.tgz","fileCount":25,"integrity":"sha512-qX5Y4Cl7pDN3Naudm1nYY+SChPCplmt4auTNXIZeYlgUcGq6Q4iH75IB9LzatGnmXHxv/yMWloWVYyl0mkea3w==","signatures":[{"sig":"MEQCIAWyLDU+LNzqa9s/gjC35tSWEH/747decPHG/hqaDVabAiA9qL/NyjSNY9jl2baxmvR009t4z0HcY6n8C15qkH8KaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeN2rTCRA9TVsSAnZWagAArbQP/3aaMeuEXqchpH6HnGDl\nUyeGXwe3jc/2Liit1CfYlVgWguPhenc9o55TbNAIK9MlDplkBGZTO3FIzUWg\nxGmnx++gpTOyrfj+NFk+j4jNCVoMvST/vE0oWAORLin51pwPwf+Bs8nWmB8z\ng1Ut3l3ugwrsGcKVTcs94mWVeo1EYxt3iaDUsHT/FRzgUMQ4PDCvxBbBHRz9\nDV9cyK5/xKYaN5iG7bWNrlgpU86pJsrGzq3tAQb85qFF4ECFmFOUZsGmyFSt\neBb1DDRVKmhAYX8HWDQgI4F4e+oaoO9NMYCmZHeHcjEcv9RXRFfoSRskMSHW\ncY4SWLH/aOa+UWBG+MgeTzC6AyfcXbj8YLcX5kD8U1r9t5iwmi6O1HNnpT5y\nOngEgWMtUfJH+WxHoYr96B1VRDRrBwWe7sGxos2zhlJuOetfruuzBHKn4el1\nuND/pGmNRxQ9Ip6DT5R5R/8LLO1Y76fxSxXWEBjqi1i94ff7ydAp0S0n2/Bb\nYZQZg/e5mnatdsLO6JDEFuhlLXA5jiE6zZuuBjToIPesyBf2ssAH2bGUbOqj\nzA6KX3mdvoJyEU038OSdijYq/+f5Tct0Zy4LYk1G2oNWm+tmp8BTBL3KJ8Lp\nd2dpZJMiIL6aMc4nNj4bU68QaXrjeONOqdnpqwKe2OmvGDDRY84Rl3gb/qkP\n514z\r\n=5CWv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"986aaf2b3e2977d7b2718defc713d72d9d87bc8d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.891"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.891_1580690130745_0.9942341299583686","host":"s3://npm-registry-packages"}},"0.10.1":{"name":"piral-pwa","version":"0.10.1","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f8f08473fc022915658367b7d005a5e3bff00091","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.1.tgz","fileCount":25,"integrity":"sha512-JrmOKXMzhPixRcAh7ki8548TR2wCB7rLh/5ObB4wTAKikJGlEzPO2xlBFPxnvmXC3ewc5tcgzak/G9Im04Lpjw==","signatures":[{"sig":"MEYCIQCOz5VGnpJJINuvSLpKsiYagtfKufDYo/246pvR7S9xnwIhANd/39gozkfOdJhw0i+oqIKl3M01a0eJa3CFTadw4+PB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOMfmCRA9TVsSAnZWagAA+RAP/A4rsxBE0VOuLHnsKBt/\n4Tmv+VzNvHdJdUgv8RxPFu9qu6VxBsm6obGFaS4FoBMbZLnMLfYwVKo755r7\nALl4hByL80ZE/gY8z6hWkyLGgIvF7CHW3CeOaeNxBBxGzN9MWFJd8KUPB2u0\nWvLFq5Ovu5EQtEScJCWz3rnyjofkEjWunGF437Zpa1BRrfaXnodaIZPv+yW3\neoO9IxJShnTS4q3bYSjFHbhACUKOMRvJpjh+bC1CrD6724vUWLVvzB2v1mnj\nMtUjB3OEHU54eRWxMPbqcTb660ta5wyMVuO3duKHz6TQZCR5m9YI+lPPtPkg\nkVfmH+pF+7EFQSJWxKfVpWj1JTd2y3HclXOPjgHWNH8f1CTDY1ilzHYZgkcL\nQhI9ZIosxYowtpDjX5Lx7ugPYUuYUi71mHnF67YbKCA4L1S42ROTqycciJO2\nl8fp0kk+ZqGWC+nS7SvGpKllke2BdXN4AZ1dkfBmEEyewew3/ipPwZ1i7yjn\nd3idpnVDkhnJE83NPuGnEqlziQnm4U4d/wYz+VwGBiNXSPsGepRQqJSzBBnR\nrxYHxiQHzXxd7Q14jGE8GpEofT3I/LNKXI0kx7hJScWo0jLVVU7OXFyj9uOH\nvlv4pgonlr0momcergJoCtmRbG1Gs90MqyZJ0RsIl+9EJUTl+/Sv31rczlIv\nnJyX\r\n=FeK2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"b80789c07712083aa194d9673d0f271a16d671bd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.1"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.1_1580779493980_0.39206055642370363","host":"s3://npm-registry-packages"}},"0.11.0-pre.894":{"name":"piral-pwa","version":"0.11.0-pre.894","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.894","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1fd5b8db6b3635957d4c5b8ceb23b797b95fcddd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.894.tgz","fileCount":25,"integrity":"sha512-EdgEsgvzoziektYLmJmU1qAtnVP2Yk4+DNihDF4YGFHw/nKRH/makEmdCX02bnCDycKuG3R5Ir4R4Tn7QlaSYw==","signatures":[{"sig":"MEUCIHwtm7i5c3JRkRQnn2qHdYbBL76WBD+k1umkb2vZ/PYcAiEApncYkGN+QHvvMTSjn9fwfDzc/Lga2HD+PZWnH1E22A0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeORMUCRA9TVsSAnZWagAAWysP+wSTtqAkPBYqNIfP49+c\nwG9qAmIdI41sqYQ4Jb9/1lJniFcw7WojDwm6ZLZzgM+cr7lWUOap8GRIEs4G\nVPObXaCcWGanOPKijFyutPIcXuv6cHirsIEBQDUTIwYUx+apCi0CVRApDYpw\nKZVZixfzz0z8Fd7LpnPCaG/3F53TX1fQ4SNa9LVVIR+nQ6wX6m6ga71Wvb6C\nBn5EdPVHeY+PvwHRxy2e9T4G+3T+EXHdSuYGnWtJ0NE7GtArKh0mIv/SiGtu\nx2NHt0uGZadEcsYsd4ju1b3W6E/xUNfjWnebIdtJyKSRMMU2utIJjYFMUXA9\nFXwHZqGkxcIPLmJM2GwVgI+UkrBDi/5srst2wPIqwtxVZp+jQDEzXG30C5kX\nNERME3XiQqlxGPNvJAL40+Hf8LNIjjqvX8DBGYIicR7Kd+8tH0YMAljXPAq+\nf61yaOK/40m07SJJ1Y4sR66Et70v5sNbxmAClJy+vmApsgJwWKQiVZZhqWmW\no1yiEzcR/kpZcFTi4zgBieQjf5fFeP8joabdT5F+RxtSJ3L7r+L9RvD62wT0\nzzXaXT+RMVWAZFlojqDJkCo8hK3g/85E7Yi5pmRitzbDHAeFiN9SaD1XuN0t\n06ef06GnICgiXdone3YNjSW3jrQKMrpwob5nymn5XO08jLmXu+AIkNGW6LBZ\njPJx\r\n=7Grw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f65d88370c1bfdd90377b7d70b51afdd9e379bc6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.894"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.894_1580798739803_0.2676572485315514","host":"s3://npm-registry-packages"}},"0.10.2":{"name":"piral-pwa","version":"0.10.2","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"68534ec652f9250c907108f0f65eba4081797766","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.2.tgz","fileCount":25,"integrity":"sha512-td6/OxaIw4YCEqiEi+TEJSytoiPHe3YYO/9X7F3BrFMxldM1eCpA2WRcNCDdzDY7DfXT/pEaDneqjRytTZGASg==","signatures":[{"sig":"MEUCIG5s3R5nz/rZ0a4iPK0DLTWu8RqGmCNM2gEypgtymWz6AiEA3vwug4XGVhlLtBv0i6tAk+3obEUMpF+N6HDwM2istCQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOtA4CRA9TVsSAnZWagAApPsP/1GLwnteyc8/P0uyoPjp\nOj6dGitKe5fCDWYIEbZbm9QFfX4E6b5wKorHOfA7Z4ca/WvwgPXyN1BoEyeI\nYuHfA2YV7w7Fr+j7WoLBTQgojdhFTi0OllDNvsfg/GWn/+Z3YjFrW746xUni\ndILiyKE4CbTB4Fx0/NbfxKq6HND6f7UHIixJ0GtTqdO4zEWRwlcTg6mUIWSR\nRK46XR5/VG70dEkGM8KJIn5Y7py6q799hFzN5kX43qL4TSJnNH+IVU1TlOrX\nIVWIQGM07NPNfnPue6tVil6G5XurIjXWxu9bVCQK8lMJXmlwSvzbfISZF/ou\nIuGW91BgWRZvR2c8ReTRP/YitnhxjBz3peaker2Jx1RUL5U/MPUvAmCd78Dp\nWRIEPearXMGvFnSw9hYtCOByRRHEv5y1cxNcom5tmSE3lu8jrvDbA/H5oP0c\n9Ps5cidmJ0w8rpY6OTO/q1wgo3B0s5wvSKQdqGixfjLnnqdiJAjlPT0FjSNE\nBOvrvXbq1tl1NRx+ovUAL9KU+4rKwrDRh1In25+CpPHsjOCrSbY2eDPShSbY\noqtEZ+EFtiEafWEYQlRMmsc9bQOqJa+FVcLSk5VShycReoB4e6GzHdtBqupO\nEb0ZmipGScsYy3MVsIxH1RZDnCU/dmmljCkJgl4x9MF577XdmGkDl+vDiZt2\niBjj\r\n=M1w9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"d5e91c251ba96740dfe9f8995ed005df19fee923","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.2"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.2_1580912696535_0.6259145504114982","host":"s3://npm-registry-packages"}},"0.11.0-pre.897":{"name":"piral-pwa","version":"0.11.0-pre.897","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.897","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"97e986c9f189bda76f252b5d457fe688dc6de974","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.897.tgz","fileCount":25,"integrity":"sha512-5Us4HZDR4hdgnOz+bxJTu3wmtS7pPx+Ssdl0zkkj2w/Iq3S+NArSolQQNEdgZpmVBBMbzLb8n/T8ekFGmD8UAg==","signatures":[{"sig":"MEYCIQD1ACw/jlKlM9Cyv+034bWVP5EgXorJui7oddSKd9QIFwIhAJ5Wj2IRh3XXmpKY8S+Hv+pqXnfztBFXUp9TDXHLshRF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO0D2CRA9TVsSAnZWagAAncIP/iKD7OCEvZb877f5Yqx4\nKGI6Zlgo9m3mLmpM6hEsA+080Z1sFZ4NnVpOGH3K+o8w8csemREGBeUR3L7v\n5r0VW4bdU6CwLQg4XddGvLJaXPYBpmB9F5suqQ854j2+2NZ/Mx3byFj9VuEX\nALsVI6U6lG6GitZ5Jn+V1RD7qVsjAvQrPvsa/Zh0A9oBqG5MorySjEBsMEN6\nlt9/BzFwEEgWgTvDtc0OJmf0BIZclOMz2gNr/7vZjyyZKsZ3jKUyGme7ZR+C\nmjJAnDczGfU+AOaQ3BJXTEPTLXXTTYYLaX/2lufNDZM1OJufh5z2KSilbfga\n29O9Rnnjp2+X6T7g2loy6OLHYVL/dadrbVJSm0nEcEczElyizOVSk63WH7NI\nWUvt/2ypvLnCWIp/FNWV5o1RgrrI9VUqFBs6kXpg3i3JzTEicZtds/uAX9sa\n+UZXMB+rEvnO4YFcDgmOez+Rw9IkgvChocamB0C/dvL2K1EMmBPPi06BG36Z\nkFh9xc9hbXdlxo1TE1+yr7JXWVo03EVljJIQg2wmkz6hjRf0GV2LH3NoI7pI\nBbGaULqbNsLD4NjsRPl5Zpu9EyrskzIsaDs4i6kO7jzZ4a5zIZXWNKfX9guv\n86coiJf5jRL1J8wF+aElV9101bxV8ZDj/SJOPWAHLyfBS+nNS2oSjDpoF7dZ\nBsm8\r\n=GimZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b375625e464e4ba5f87d189cf3c31c2f2bbbbb3b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.897"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.897_1580941557604_0.017041685320164257","host":"s3://npm-registry-packages"}},"0.11.0-pre.902":{"name":"piral-pwa","version":"0.11.0-pre.902","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.902","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6b0824ac4daf8c9a821198e18d2f536a47a6390d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.902.tgz","fileCount":25,"integrity":"sha512-uoICPIJ4RkhuA/vYX2ovCp2ac8cuFq4xMSUwr+sCyyRq6DzkwUoISukb7UV0T5FrY3xshGScFfyrqTtW2MT+Rw==","signatures":[{"sig":"MEUCIG1Yi7fFMRvcjmIlOwmKv0YQTmzYDYkYZOyTVYQzhUi7AiEAoFi8MEbDyuyATtgeGn+EWbrOHwmYgNahSURtBI+b0wU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePTCqCRA9TVsSAnZWagAAvP0P/RyAz7ZpCIgb/pLmSm4j\nO6JrGuMKuybRa9wHLA1MXbJw3Np9fPgwMehhNrfgiVgmO5Qv58OAh370rENj\nuhQSs12N2JNaKqYF/Lor/tHNSr+WbcB0ZQ5ViDSMcWlstp5x6bm30pZCTFvN\n24mJH3hZg3zT8ZbRH0L3s2xoOoT8KJm/SbdrLIlelH6QgykpiWN0qZPc8n4f\nyewGi6DXsUcc2+e+qXLJKTm9CiPUhwlI28gnMvK6fsdubloijTjMbvJQfxMj\nxJI9bX4SxIDhLtmqJn8+KyaJhs1YrpkdCCyAiUwcsV3YWuqe7gKoK2J2Od++\nb8zbvc3DAbRnOHe+ZRmV+F1w4jGXcMPhv7EnOQCObPDRKw64H4la3G8+G/6/\nnKQmYyJDrAeZZGRUN622yjRVskiYX4X8O09fc6HQy7wn3Cye6krhJscdbUlo\na4z+FfG+67iwaaQME5YaLIAGvfOaE/Bu1++o0MloOrv4lBwM2jTIw3T2gSO2\nsWPYZb5FcCYvI2LC89KZRgXW81fDf20At1+9gEy40c1/gFgTzAmDCGG+cs9A\nvxovV62UWXGzQM0ot6yQeebTbpAs2k4Ug9n++PKlMbzAnk56I/Kba5mVfz1q\nf2zPpIPSFbDxUeNE6LE7DHay1koLlx6oyYJ1rZ9z9JaOUJn4kAooIqxEARtr\nAlBw\r\n=T7IG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7cbc35af921f49f7d664edaaa70757e5e7e21413","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.902"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.902_1581068458533_0.8208754951454817","host":"s3://npm-registry-packages"}},"0.10.3":{"name":"piral-pwa","version":"0.10.3","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5cdac2c18b9c723b79ad3624ac2a0b6f67413de2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.3.tgz","fileCount":25,"integrity":"sha512-YOLLHoSU6dfLhN6StapNRK8UCXJ9d6jD3kKzmAQaDXo08M8SA3jRUn2qtEqAZVfvYNt6UhJr0zNmqqnrpxgYdQ==","signatures":[{"sig":"MEQCICY48KSs7+mwm6ZpAh8o1LkZ/G0e1OEszyYuK6vOXi13AiA0vhtgOVMVVDVXrJjqguCMi0dC58BLfCf9YXi+Whh0Dg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQfV8CRA9TVsSAnZWagAAm1UQAJeFQTw+rkig3oWOZmRY\n36yOTH0fKp4LsexpldOQFpqGUYq9qr5lUKSKMo06Bg9e1PVNDyGzbRlwQeKN\nRZlVoQqFE7t80UlFuyOONyPaATJi2X4LsKzXG23vkVqKYVM7XHp4EySaI83q\nJK37iHJWYBmEMv4kTyCdL1cvdfekKq34Vo6rJte3M7en5CI6YcAQ+EXAThu2\n1TcnsdN3d4VfYymECGsYO7i+DJJdCaSr3wz68hgS0a3lwg3rj3pLr8jmgyCv\nKlYxJ2yO75pwr7MdCkqXVN5BAq4OcnbkWOTZrGiTclJhwFwXhNM3U2tngkAv\nG9FfsR1Gdh4xT4hCVFFtama9U8xL76nkCx26MvwR9/vRrBzZrAUH9lMOL4av\ngPTIKMEc9kTR7Qu2MGRYBh1XO2zKvBK7fPxr6NID2tymi0Zgkj9eklBC5xvT\nsLIIjHo/jFArqzjlgdAka+myanFGfXbbt7eSQIoMAc7G2NuHxmb763K/nj/G\ntJy24fEmka9O7yHjgAzVqliso8wQTjFJcRF8+6fkuS8sWQ+Nx1evjb4zjDFT\n+JWzXqGkT0/oP8bRz6rq3yKE3dwbjMoeOmDvKc0z7+abftEr/0JptMSpgJE/\nGzXJXkVgKwWK1uygPm8qYG2U3iZLJNL6eVdeZcMRmG5X6vvT/Dk0mwOibZIM\nPu8l\r\n=MaUN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"0ad92f1e5688ada20cd1b1cf2d4ca8d9870524cf","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.3"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.3_1581380987889_0.839561904008354","host":"s3://npm-registry-packages"}},"0.11.0-pre.937":{"name":"piral-pwa","version":"0.11.0-pre.937","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.937","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3e193ada197515c9a5120feaef047c805e790218","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.937.tgz","fileCount":25,"integrity":"sha512-I3koAizp3kdVs8XcO8yU001EV3CbCOn6HHoJlK2DO/9wz573gaJri5o7MQDDXL+zczLszfibaTuvFWBXvrZLRQ==","signatures":[{"sig":"MEYCIQCZa/YuKeOaPnlx8HEWU/j0g8w72PQHDSOD+/fP73W/ngIhANFGcNcDhvGZCz7JLPJGm8Vo/vq+335wGVFTdQ1S195y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQf3ACRA9TVsSAnZWagAAlikQAIOe4oJmtYZ2NU2OGail\nP9BswKOyDa9hi3+Ng00m1G/vCRKfbfUERI2y4tCZWQNlhyNpvdzBSXbGXX6B\nUJTzLfXP88Ka/NnzBGbjh9gOIEKdsW0DxqvRJSkvAd6etRcLxEyrRbSaFGBU\nHN/3oxEqRnnWdthNBZteWKOYPnpCVMDCqi30qPNb4WM0vBXSUaV5dDGWQ/0R\n7M77Ew2yWxBhPDQE57BZUcq9kCf1jrRL/0jAHqdBob3ganbAh7jB99riEvVk\nBymZ7sGL0cMsS4hLInp0PD9D9Nr9O6PNvjDFftR/TGcnAFgMcesaYx8efUNT\nKFkCQGiWZ2h/X9H3whXQBCHa6PRCBmKBjy6X6eQs62FTvW2Jfg0dYxhK+3Ot\n2A2anvOE3c30rMbdBcXQjra7FdpfI4WAmyYL6/InVzFV+eKVljEniLMo2sry\np7PnX2Cqr5yQn3VEyF6NYeCVrWJ2hpaUiXTl/4j/rzIZB7iBnlbYCce3K03O\nlfD4amn/RePEbdZSNFHAI0y2fA7r05eugppTOns6BHEVmsMoTJ+iHT2Lh5dt\n3m0laqBmdOR7JYuWQZZ/Nt1qJ4q0PUYaFMdoog2L1aG3s5vFQUYfGsK6MK80\npuCvJJe9tvJqbo9RiEsQhZjKcuCv7trjXBuEG0oVVmU5Jm32tTq0heETHu/2\nczHr\r\n=XIUR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cbf15ae350358a406b53eea1774105ab4b02709c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.937"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.937_1581383103485_0.5951491425499202","host":"s3://npm-registry-packages"}},"0.10.4":{"name":"piral-pwa","version":"0.10.4","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ae6500a50a84617a7c773e2328ae2b9323816e24","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.4.tgz","fileCount":25,"integrity":"sha512-FH1UAb46tpNNR2OYwlXS60tDzQCncbEjY0ykufxJ3Zg7ovcE3CD+Ib6ueg4D2rgIbNhFvhYLGDFeoGpR5FQ4AQ==","signatures":[{"sig":"MEYCIQCbQX933gZHc12F3uHrQJ2kosOrOrBROxfUf/tETaECFAIhALiNPXPIcVckAlNJZgvhhHb0aDmA9PxgBa2gk/rOCi/T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQzKeCRA9TVsSAnZWagAAyNcQAIlS+WxBy6f4hVyuMcwn\nTMSTgJjcBjuX1TIAKbPoHwS1TMrKdfI0K5ftjoNYevNQ0UmC3sJ59dH5alSp\nkd9onix8b351C0mLZ5vNxE211sbLnun124yk1fFnEOxhCZ4b9g0OU0KcZIO+\nsUw2P98PibWlrdO4q8RcKUS6FABxIcw74IRhdQX/kTqkW4h7Eh43hTJKnFR4\nAamIalGaO+MOrgTLVEL9Ui7hM7hoMmciLmHQcfylUN8g+VFJKlEk+HAGBTBg\nSBlVMr1VpFxXZCPPaUsNQfY7rtLbKUGitvVrC2Fzp5cdB7GbA4khfg2ppk4k\niHaxeDDKvd2HS7olVUILQVdlHQLFN6BddNMm9K7LpM5EVHByYpHviOu1isI7\npkd72Yzh4ysnIRWmLT7eJqWog765DdK52HK0Ck7CFWC3sFRAob6rmUZyk4Io\nahGnzcj3jMXY+/h5FJCbDdfECl2pFJH+1bFECCBscHuWHTNzPZOFsED1nb4U\nn+jYKinWcMBSHHLVinyfalk9qEJviLVwPZmeV/PvhL5zQngYxXYa9mAhtsyV\nEGEdQKE1byn5BQDl8t0dR5Xp9zAatlDb+hEbWhGBO8Iqc1VeCqhXNWr7jY/I\n2tVeG16P/8EHc7qKlfqz4XjUnVVtN3qpD7e7Zf/BWoWwMHi74qQ6KBVnEgHI\nCKIO\r\n=WMjE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"e2454461b557445b87633c0cd3b655c0395f711a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.4"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.4_1581462174124_0.492663328189477","host":"s3://npm-registry-packages"}},"0.11.0-pre.942":{"name":"piral-pwa","version":"0.11.0-pre.942","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.942","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"752a4497275969f25cdeb81d6205708ad6a4bbd8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.942.tgz","fileCount":25,"integrity":"sha512-lLz9j256pH8SkSwareFb4642X5gjn2B9tR7Lx5Yzmaba6RnUfSap50Ph8K7bFfP0mqqnyxH1KCUoBTBNuL0Jlw==","signatures":[{"sig":"MEUCIQCGsptvT+/OUOZJ3ytQHHYEe4B/DQZupJbg78cGZtK3AAIgOMt1W+6GVDlpqJip2CVwKA8Q0CTOAr4m2Dddbw2PFvw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQztfCRA9TVsSAnZWagAAuh4P/Rx0FzFrs+BsQ5NzPC0h\nBRKvcTs8AdLa8gCg5zD3NADydSaqNelCrLdtrSsPYFiK8V2vOEbzTnFg3jQC\nkuCFGH71CM88HOQAofdJ8hy4+02d2ledgf335pK16XW0l0o4Gs6Dg7taxNhU\nUZVyo3fsAvjZCbKkGos2dHdKYInPyN+UyXXY28G+x3OqqwkEurm2OlQSRgko\nmw0IEd7yCTxIIdbMw8x9jy562dkWktcn4coEceWnZd1ee45adMotGRK4iBZJ\nXvp8DMff94tG5F63LjzXjPEHK7QOMiKOnP0zMBym0Spw5Y4PPybsiAYt28El\nAWkgMRpawRLsbh/Du2o7L6rvBF455So7+HW/XKQm1+MCpzhkyN8wJmKXRocf\nsh4zhzcEErxYZZXkCYjB4lxnP82M2cIUE8u6iSjBnvn+0Xg7AW+RrU1sRs7e\nNytH6O1M6c+TYzEMadb23TTdzz/lcj42M84n1Xnft9si1PqZEX3x0I45Ca0x\n/H+4cab4EhHHlxwYQYL/pptnwnAwlD2DEhKKrAJW/+vfrKAPRYweiOd38sa6\nqB19fW99kKEpTZxtmM+t+K9xGfjSG7uPmZmKsbQO6q+IsyPjqO+aAX6e6Xn3\npyCdsK4Rfb0R41NET5U383apRzEo0Xhz3lyXdj0zz3MUzGtf1P3FI8T1kxuw\nrlfL\r\n=bq5D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d8b76fd7dbc640799c7498884dfbfac8d8209ba1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.942"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.942_1581464415238_0.7051883158909906","host":"s3://npm-registry-packages"}},"0.10.5":{"name":"piral-pwa","version":"0.10.5","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ecfbbe3dcf1703ee23aedea56f1be6828a6dde10","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.5.tgz","fileCount":25,"integrity":"sha512-2DjzLxl+K226i6tH7V5mA/O3FGfHXiUDmQWTEIDbW67Z5WHb4L6kKFClQBbFGT6HzCxuqf4RP7Itc9UGi4q26w==","signatures":[{"sig":"MEYCIQC2WyU50irqUEDtmAa/sScWgcxFk2/VZ2It7Ff+JJzuVAIhAMYvDplHfzFzJsvZwCqYQxLB3CdzaOP7w8TLCWjgvXQT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSDDWCRA9TVsSAnZWagAAmRoQAI5XZkESqX1m1IzlLC9I\njutVc55aLO+87NDCDcE1fYGsmVH3FwtbRGUgBMLlTnx5eKsQFKMoEb0yiLjG\nybaf54ndle3iY1Nf/bQJHoaFQUzmUtJiy9QcV1lCHnQKdvRdGAk+hDqdAZtq\nPO/+gUsSwhJo922avcHvaqZGuvPGAOPjZXMO6Ry8/L4oKZ8dF3KXhBvN2Rqg\nOWNJBu/0/4KazTqfKE80AuE2ipYBREh3XaaHwCmu4pGksmhiSBxBR8HklWE9\nceUlxXKRaoAE7kQJvXAqFTT5OONGhFxejjQFREdJ9FRn+pw1KyzYogVmFX9q\nUX8cUbjm1WGqWZFXDmyhKxTrflwrX0qzRQ2X2mPkKUHlf6Hju2EPLycrO5Ji\naNeKfJIJ2Vzm1FldgckWVgJp89EijU/leVrlELEdtYKEqT5xFuGn5kyDzkTi\nLbV7MGz4D06MG7UsENrhRY2XOmtD1Ui7qYceLyr2dvHz92j8ih96kq5bVvTn\nhiMTsEeql9AJyQAgKcpJIow7aKHdRF0bPW7hYARQHTmsqlrEkCt3RFQBi+/1\nILHwP+YeHou5heaNb9f8H68RBRWJyhC7wMhLZAwg3HKBK7hWkVh+nef6QnSE\npkwczGi10vEEEskwG7gK8x0ubvgRGaWmit86zdvHzxLII+7bIx1aMYjIpYIX\nTOwf\r\n=0eCF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"77dfb1862c444a44c3d052e7709013c687f72dbf","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.5"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.5_1581789398188_0.4196765257640749","host":"s3://npm-registry-packages"}},"0.11.0-pre.945":{"name":"piral-pwa","version":"0.11.0-pre.945","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.945","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a32ebc014f526857abd63e04fe87f5ab1506f2e3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.945.tgz","fileCount":25,"integrity":"sha512-rI02ryLumvoHTYg+EaJhkpag+CUHrd5LnbglKl2TZFgE6yLvC3bbWgT+A9xoUgmua5GEfPY2UOFdBiMx4oTboQ==","signatures":[{"sig":"MEYCIQD/oG25MAFFA1vj6GhYJmg35gMX4TLwERqpcYc6j8Tq/AIhAPameWOPjQaf25oChdDjEqpgHVCQb/JuPL28qEbirD04","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSGiTCRA9TVsSAnZWagAALtYP/3PzbXxLITXNLxBAjdzE\n8FknhqqZk9gPCYZUmHob/s2zIBQ/MnJG2VKnbulDf+mF4StlVqhrzt+G195j\nbMzLotaJ2Tu+jl7YoY6v/Qh335KBhsBgNkzcR9TdoFRSDwWCR4qoi+kZoyA9\nUnvLiQgxYUgN0DtE+RsSSBoz3citLnnRkkutFjeOaxuxM24yBaj8Ct4PXPvq\ng0/S6kufvYFS/q+xaN4EwbYwXHOM1mjqoo3/e3uZd0O1VkV8EKZ3llQu3QgC\n03jRAf+LPYZhwkEY5pVxD+rBOgv7CXk2ZO3bSSq3eXr2CxaFZiBK88q13r+c\nI0Iya4h117Ir8TmNiqlI+egSvz950SMLNL6U5E9IioZYC669TYxYdQq8R7l3\nBHZOoA6Di8dVohqMK65DwMMNpO2dsSNB6rws2/O4dLlR905WLdJ2e2vlU2ux\nxZJHAHGavmvV/xcLcd5GAvKsxsukLb49Kwf1mLhwi9Mw+w6tIcU0TlUvMOn2\nLsHGfHfGbIFe6aBWGn1iiblXsGjfdNOVpYdhhLmh+Wi9rgzaeU3TNc3HVKqo\nBp8K9sEBNzGxJacw3XtG/Rvj9Ox8hwXovsDmH5fiWF4X4fyQN8XyKTRAcIbZ\n3AMmIPES5zKFvCJfSlYLaHjmPnpBhs2Ggxv0DBr1IHKZb/Jw4b535nXezIf4\nMM12\r\n=gwd6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ca915d3b6a6136e8060b764162193ed9a94810a2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.14.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.945"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.945_1581803666928_0.5492790225628006","host":"s3://npm-registry-packages"}},"0.11.0-pre.946":{"name":"piral-pwa","version":"0.11.0-pre.946","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.946","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3959db84c3089bd6ea0bf3d7cb0f715be63a9928","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.946.tgz","fileCount":25,"integrity":"sha512-LEFi6VJ/GZMeuT2QFikrwph0Pr45Zibtswr4AT047A9DSMm/+PvR/EihTZAuE0hs5kf922qG7K+mQ0BjvhphhA==","signatures":[{"sig":"MEUCIArjVC1GH/lCKD5Re3DbIRPJWKUDczm0/jRvdx7VGUiVAiEAib0H+7+YJ+O4jpluc7WOznDVGJyGhktryQMWOGjnQLY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTFzxCRA9TVsSAnZWagAAjFoP/iVvFgBp9FQ4OlGgBVxS\nu2fArdCksZuuKhoAPy7RWnvqY7R+g5w5DwG0G0822ZfCE8+rqOa6MDno7NJG\nQNnba+N4E3XB2lIyrYHBvXjfZnhNCCSxle78tN3jePRKUaJakez5fLMF3IeZ\nqh5gXYFNZDft6k8IB+k3dhk/4GN7KMDPBzQEYc2Q3Vbu8KC9aRNHO3xh+9n6\nDqx/vV9s/3EIF2yj/r4JKCUM5h0xQfK/HP1V3Pb285PVzewpJmqYI9dWqXOv\ncOW5kQUdFXErsa1NTdGeTuqBqeOtDhIcoa1vWVZSS0NS5rIdnlEiu58/R/nt\nq8uPmgL81s5XCYw4Zq9mMh/DSgtwm0Jb93NJpZZvOWIPX0RGuOCC2a7zDpEU\nZJipUp8zlH/fI2mhDREBTP9pFt1HQksEYrMdKcK0crlYqFDSLLuAcFvoLVz8\ng43NwBD2hHzWRSslGRfyENE29mmxORLFUto/l1llZKUCrlRhI0uOQd4kJwY+\nrCmS+zZ+9fGU4pE2RrbMyJODlKXHlnEjwhfS/b2IMAO+ldrLQmU9wCxRDHf4\neHCGYBRaERANJYxN0/8W4GiNpuzMmvIkf9YqUSvvaHnbQJNaXBrdEMKjgBpw\naSUvw3Mj1PStDNmvfxik61s8rf5j+0Z7Ot4VwIr2gUoBGJXj2WMhKR2q+zIY\nuRvL\r\n=c9Tl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"57ef718ad4bd78b8be6370d61b9096bdbeed054a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.946"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.946_1582062833280_0.7560054730738379","host":"s3://npm-registry-packages"}},"0.10.6":{"name":"piral-pwa","version":"0.10.6","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"825684babc0b22c2ab52e3c225c6860046af5be1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.6.tgz","fileCount":25,"integrity":"sha512-AYDKWVPjGskYqzNUvx0RMYnf0hNupnbNPSqa0wzE19YXfCgar4mWF99PIDRi8uVCKDpLYiS0QoFtKUGWMbf06g==","signatures":[{"sig":"MEYCIQD2tupN1MU3EGeEgffD1YLunCKQZve/g+Z03HftAIi39wIhAPewyzRXx6ysCH/dXNWtgoLuxjjGBjyuzytrFVTrRxOY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTv/5CRA9TVsSAnZWagAABtcP/3qW9Rf1e5VvtJwvrGvP\nXZVLSHWz6lBcE4/F0Z+j8lpmKSC9XQRwUn3soDSCjrMS69JMfyYzwE2yJXbE\nX17EaQbbWpY8P1Kv9yq5HvdqJS3Djfi4IzdlBpTgKVhsRNZ93PiHa4+Orb4N\nBqgBxw8lOhudqP2JVwAKVsV1Gqv5jlVt2ToxOp8Fh/LWyMx+HqjM2bVdm22j\nRNC8KBQ9OQcEJ9E/AAT7OBB+x5WnclghUKBQk97StfR+dgDY4Innw65FoboV\nOJSxMXDT7B9EG7El8u9M4uqaFzuSMyWZaoOBiqSIY8MT3SWcgxip5TvsOC7S\nPEEkPi/aOXKXCSHQAcKmSkzp7mela/oG0YQTYgv9+gQyvoeYqANUghEHOxgM\nO1tSJQ8Xh7m0ciFCcjRcLTbzW6ntmMGDP+IMy/yUTDjKnJI5VfDiFJgortdO\nfCLFqO/84583/5mqG9zhcNPCQigEHaaWpGvopVZkdbTuOBn/1ywmZY/GnBxf\nXPAZqHx83wKHm5WXIgVDTm6aYqnDSafg8lF2ZrDTuDNtdVGQhpnutn5+ozEu\nhS32iVP8RY18ejdSd8vLuTMx1lCZaNBM0YuWRCFlFKD8cBjCgx0Lj9iHE7Wf\n0sFmSPW6Uq6cLBXvESaCOc7+Iy4OxEAsJihbShFAbuRNoA2PNzW+w4eZ31zX\nqSsM\r\n=LiqL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"183d8436966f4c8bb96897e465c8d2372e1be7da","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.6"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.6_1582235640756_0.19387719510361023","host":"s3://npm-registry-packages"}},"0.11.0-pre.956":{"name":"piral-pwa","version":"0.11.0-pre.956","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.956","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"db4313a8de3d0a72afb684603e3de94d1f448e0b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.956.tgz","fileCount":25,"integrity":"sha512-U6rOYtw9JO3SUJXXWI1nXTEpL53eQOKG8fyvhp1cOoopo+f+VOu54G9RYVzUyg8RHYxHleh3V/qti0JjJ+mSHw==","signatures":[{"sig":"MEYCIQDorb14cA7z4hLhLozJujAmGWKQZRk75FFKzNxWDyshaQIhALITLIxLpie0gcgkXzuQenll/aYq4AIgHOGIjCBlp+Ja","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTwfjCRA9TVsSAnZWagAA/o8QAJFypiVmrk20aTVd2DNM\nIJpoXJZmpDy0Z4qdsJvwR3BTYBV97ywrRNjxIlIns4lDvDJMnSDZKH0Ngvqb\nV+XIJMdm4pztvuk3jYhObeLrk5/gL0rrWIl9Ztx+Pea+ATXXtJeGzS3IWQR9\n2wgDLGZW8R58EMnbmOWgMwJUTZMUh1Qs2VLhTZ5pfuAQ4NamVfR2l/gIy4mE\nG3z9ntAXfYnXrR3bXPEzCqniOwHNpym58g4+4vhots9PtcIlny/PBRMSh+oH\nqI0LqUngjptHi8JpDqTgYdYarPsSrM2HFYFWJl49OsmucwGzk+fu93JLpFS9\nSMGEl9ui1r5xKc0J1NsJHOBwCwRehBbGis3/KGrZXixqggl28dggyQZyOfE6\n0OY4AYloludTQV5QGEa+F335iLB9m0vT/YxdWeiolrYRbA777ezCAIjzlZq9\nYLJKtKLKWnGb66cUN3JWb05Spc1XorwgJf1grfktyLCxgdK8UAEDdrD/HPPe\nM/BYVUexg52pJR/Ofo2acIQ8vDSy8P54yRZ2a+l/f2Af/3Hshlv3abv4VjJz\nxcVn/q/cErI00CECpZiKnvEynDqxUNPuL7cFXWbSkfILZ7LvarSkNqER9Not\nvmaZVyv6CzZpS4u32CCwB3FUnBWa/tiuK2mozk03sUDoseTGMfk1/PnDAP49\nFvWD\r\n=BaE+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"374a47fbfc650b2c9a739623445c4c942aa5f0db","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.956"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.956_1582237666451_0.9365289690107812","host":"s3://npm-registry-packages"}},"0.10.7":{"name":"piral-pwa","version":"0.10.7","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"99b4b10fcc971a2c95b213356c8a427508be5102","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.7.tgz","fileCount":25,"integrity":"sha512-PCgYf58tAWb7+jj6jIv2InqkM+XQa3Pt91Hg/uu0+6WwLsQLrlLreQdJ/yraG2A7dW0otr8tFHrOwGP8g3/wWQ==","signatures":[{"sig":"MEQCH1tkHslJJC3SDOlrk5DhHz1B4qva2RRc6hhx7AWXsMECIQD6nYe8pLrXeTBNejxBfDAFPhAF/P8iPZEQ80wq9BEmIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeT5tfCRA9TVsSAnZWagAAcfsQAJyLF1/8bWCIQbTGoyyX\nzCNyVJDaXwWGpoQXdnr2n7aTiu66E6ts8/j0zWf80jVYBsQmZoFTm6b/XOtw\nd9ROHUbjQJLP5hnPNsVVugew7jBoUmJdtbJkRlhTIGv1Kz5pQduqx/r5PYMr\niEKh3servJKdg8shwPaNy2RyowjWeLpUsvOnJUc4kRxzF4VKJj107kANYFKl\nn6xpyjN3cf1B/u19i0UNY5f55VS6OpiqF/yJXkm3b7F9u2fimJ0OSr2fjda8\nL0W7yPTrFoNVzypOcRagA2XalfKSGLbE7M9ZpnBmJSh3nABbT6mIQp9y6bwD\nZ7HoCODdZLI5QEGNvJn5pE5bgcU90Gi+T+eZR6fH66lv6gf82cR3pU8oi6Fy\nPmIGgbN5kAsK9m8eG9ETBZMcpLrzFMo55dO9YBYknJLBAejesMAn4HdXQX//\nA7WC6ninvZLIqDgwIYmhWWe0j7T4vQjEc7/G28o/Em2jSKkLbJrDs4kewufq\nqKcfqJdox+ygZcr+MJjCGcnVJmRT/8gLaBuEkEAbvW0kPpgS0DWrtf6z4U/U\nzHI0sU7/tS8frteCx7J2jOvntCabPcVkcQyC0SgOX6DHXnl4m8I7KWyRyWlo\n5flHd7QEjU1p+qoQgI/LqV+832/wdJyHFhwy4hfi1q19yb7rM/XFsU2lLimJ\ny2/V\r\n=ukSS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"5032f42229ec16cdee45d4eba49b4714fdc970b4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.7"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.7_1582275422899_0.18790120709461577","host":"s3://npm-registry-packages"}},"0.11.0-pre.960":{"name":"piral-pwa","version":"0.11.0-pre.960","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.960","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"84c2530a6775622e2520ed5ffae78c8ed5a93859","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.960.tgz","fileCount":25,"integrity":"sha512-OF9HU1UsBy6KANFg1rWfh8GmAmhQGR5wpiuV/1Z4Wf4ljHNHeRxsRU8JYu/fBa+AtOuCuw1irIP6O27L2Ptt/A==","signatures":[{"sig":"MEYCIQDpdF8uIbO7wfzel8r3oPalQwlAiUi1g+X1b2XEM89RhAIhAI5yiyRliz2bQ2TgOhtDqlOwIE8ZIkU+CrDRf18h+h+3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeT9LqCRA9TVsSAnZWagAArfwP/2dO/Ypqm8c6k/7Doltm\nwaSqCbiHKkr8sBwjVbLGrimLIz3aXRSzEBQnXLxDjpLkWVhds6sUE62cOFrn\nJIMjEWH3WP2M+cr2mXSEpI9IrSegKmlVKSJkwJesH3dlP+CKxT9GIc2JmRq3\niS46aOsssUZZ1BYVLzLH/DA8PRxJRhj4UXQ/oHcVZy7bxHM80T9rW94Tg0Bb\nUfZi1LsYQOivOqyKhu3El5c/J/Yw3BlSEnxMqmTLQQ1NbDFcshqGhI0rxXcA\nAx/D5TJp/cc0K3mGVhg7WjgOqHKbRClPol5Qo6yWYJ11AGD5L1xd0qjxwbNj\nh5JjbsZ2A1Loss1xXSt/6oHVgqXfGH0GogYJIAksBcbMCpN/4IlMJhK0NTzJ\nFC5v2JpbmRPAFFz9Z61VyhEDzpbBYvBGtpu1bcLtcQf9MLYtwqc/byfE6UTd\nKCzvydwUNWm43fT6FSQvkHxeRvnH5DT5mZhOIVoZElbBBbH4Y7OslYfEhA+q\n9w8sETG/tf8WqrqWhpgoA4viQvmiiET6pDIzHnP+KhA2/DIMdcrcVcIedxty\niYZzsv/sjSZkbkF5NQHTpbdRCxX7LZa0YsETIjkpYLj7XoVTQunR/MXKv2Ex\nZkLvI8YXqytHaH5I0QlqsM9WGhsoVV5PFxpT6zJAzG3PzhkEmeqz3+5NRCV4\nNAjM\r\n=dMaq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ae95c261b5c880bf19529c1361a3cec529f8008d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.960"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.960_1582289642355_0.29762030243322823","host":"s3://npm-registry-packages"}},"0.11.0-pre.963":{"name":"piral-pwa","version":"0.11.0-pre.963","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.963","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"07e1568d14e59ff631edb83312d3d1222ea13520","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.963.tgz","fileCount":25,"integrity":"sha512-g0s6khuixeeGx2ehkFUENSMzsLRbAM75WHZJCqrrS17Iofq99JYdnUy8Gi/kD2GCEPNCAX66zXnjlLCPj/ExKQ==","signatures":[{"sig":"MEUCIHGIRhsO/86CiNO34q+LpPuGX+oYMFGjHwz4dTk8OjzlAiEAgSllimOTbl1uTxAGFpGIhW/awlZ7S0pdwOEiZuOk5aA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeUkdsCRA9TVsSAnZWagAAicUQAKErH14vTodV7XQIrzMj\nEl5smzErDFqJ+kYwq2ecifN+xNWVWBTDq/hM8CNmxDZL8iJgMi2MNIIEs/zz\nv9L85aC8yGu0NS+4EqMHw7HlJMmYhgpvuS/QUHBgeZGDGDC/1boiq2/8sqRX\nAEEB6gOLfbNQ4m+mYSQsfzKvVWCFXrPsecUTuUBny3H86C7LpQ5iIIHhaBwq\npqbWhtBd3YNqXj9ukjKLMCNemOHU5SGbkPoe1mOt3xf/0su9Vv+QpmnbXRHM\nQupb3R39aTrCS8Eb1+55lP2tT6jHEPe54/HCtiLpTzT/vZirjXh7OAnvy5Ei\nMT8c88IWwi40/qBsDNgwKLsCXDJzpxePyxgMcOGiwUwnR7V04P088IAQ1+tX\nL6OcGhATi7C2WMqM+5A3hWpS6/853jqq7nvnmZa66msC6YkvZ5VvaO8x9Uhm\ndN0jYbQ/PxFNNcIqujjfdliguEKe4RbOVebjXRTpGdgRsEoVKOuZlLBA82It\n4/0i2d+05h8eYSx4FZJmk+Xv0RyLiWFU+7ZkWwsEGkE37y9Qz8l2YN6Mf72y\nctWbHVOeWduQ42LFSUCGka6YGXJjrpiov+jN8KjfBOJoXcv1Rtb54vt21O2C\ncNZ0Hp6ufHu9Qq1QwRdIq7Jy0Mg08+430YjxZv2Nch3VuCCbprIv/S6D/DWX\nhcAX\r\n=Gdwj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e234ba6d0a33bfea0d1d003ea3c4efc5debc5f34","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.963"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.963_1582450540530_0.6895793159442629","host":"s3://npm-registry-packages"}},"0.10.8":{"name":"piral-pwa","version":"0.10.8","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fe4f5ae7ae8f6ac006f01e86fb364b55eeaf3ae5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.8.tgz","fileCount":25,"integrity":"sha512-LJ+o5OUO7pmoe7pTPG6CFdTdohFh69TQh+S/bwHSs0HSVX8zIa9ABhGpzkfRBj0RLcIibCJ415Z8BueEfRnI4g==","signatures":[{"sig":"MEUCIC+rVKSMJCcOs0KexvJtpyxVCO9AP+UgfD6qES/jB1jOAiEAnTeenVDYdAL2AKddJ7F1Up6mD4wNWH/YQntI1SQJSOI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVUNUCRA9TVsSAnZWagAAIGkQAJSbgF1kx8ndOCvFVSMI\n48r1FZNACuDdrt+dlwpIoHsovb8U0vZn/iX1Crih1ZOR9ejicR5hly3emiV/\njwL1aNQCg3AKC8OBu/1b4Evy+mhm1HeuMXlDXMOa/2r6BaAM5mys3azd+Rs1\n2qxSQuQzL1iY7aTSlMrigXHKNMVBVR104l/L7al9XX7gLDpEkbF077l1jlJr\nLOga+/LWTxURjUmm7agD8lVtd3pVmba5Ja/EIn3nex4PZnBPw8++mDnFKIg/\ned+QG6yY66amS4NAL/1JfIEqZ4kOroltwa42z75s1/sFKQR9PWdSDOHzfs6O\nNV1PemVt54bmafNFIqywaeOiBCxw8s+dk0xnFewP+qctV1kCjhHszUm/6wR1\nCyIZIKrqT9DrJXWUQZZGfze3ahOjWYfqLo0RCcmq/MIF7PmKTBAdVSmYj/9O\n+Db32DHt/ivazRjijCrVwHB0aVU8FuS0Oz9+0tfPyPMROnV2mEoUG/lkp9uL\nNqwvW06632DhFwDehhpktpkfd48QCNvSb42EsUaCdFCDqyMm0k5bpwOhYLsG\nGA8e5fva3Oa/51ph7s1VayMp568gvtvYZlE0s7OuNIa0ISf9q/zfmPjB7Qb5\n/530gBGy/ez0riGiCioS8Dscpa3vQ7I6dlZBwfRMedZwKHSvB/JGRuQjRJsv\nKFR5\r\n=EPeS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"eb6ac0ed3ecffa9e3574107cb8434961301dd69f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.8"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.8_1582646100069_0.10027009440788337","host":"s3://npm-registry-packages"}},"0.11.0-pre.970":{"name":"piral-pwa","version":"0.11.0-pre.970","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.970","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b06f6ce97b8bb334208a9585f849e847a1d39a49","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.970.tgz","fileCount":25,"integrity":"sha512-WMybqACDX/nn2stofA//GEeXFvpQS2iEbxenfkfZ8Hs0Yr36I4mlU5UhzU6NMtLSn8tkHR/RJswULgP837Ppnw==","signatures":[{"sig":"MEYCIQDKONjlW/9PCRMFDY/yHCf+lfpMio4/hyccACcXkI0VXwIhAMei8spWLY/h0wsTCocFAfZ00D4AzYfZ99dB3Om2PRME","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVUt0CRA9TVsSAnZWagAAkewP/0QZ/mbRJyMSOeHiQ9rc\nKNKDkJgFV7Rs2CqYtPBLQGGalw+EJdcSgIRPxtynACX2DEn42/g8ocCwyfrO\nkycJvukOXJkiNmGWPiiqmheq8yzi3Xwske9HwlwcrlINDkR4rYfcifuv2W4D\nR0mw0/m2tWixc7deufgVHKrLSDWRyiekR6XsTmw/64ZPnqsTlDKUpwxpHG2x\nmYTT/cPSUc0uQMEPet5xwg5K6CzI/nHxbE8/agdYBOt+qto+58Lug1v8jsIu\n2lqY2OltJ8FUgg6hSU5JyLgSeMnlkyjfoHo/DyujZJizGOD3xVQJhKXBraU1\ngvqGIsj+dHqCWAtBN1hYL3JvTUGP60oHLD/qXr3L4jU2Bj8gDISPym5sEqey\nALHGdvs5T/lIwXreGRwpOUgC92SQlRcU7TgUcIWgTs+WKGOQXr4fjB32U0Xp\nLv0flx4hdWdw7OQRH+ZrlTp/4BfeK6li1u9fvExKVDlZNYz3gbqe7ZU+Mmsr\nwZ2sw3udnTzs3XctjQLzQxB0EdlnyES2aE93aX28NypzV/q7zMwZVOBTY1Gl\nl1f+5jahiz6gJFCXuVyLMCs42VfZtUpTgBOMqh6S+GJDqtcf/8ywSMl5To5Y\nphVXD3aVmQXrC4J0Ha6j3d23qRQsDlsj12JgYEAsry2c9PMdeoO9RzJvPkrm\nydYA\r\n=6P0N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b64bb8c772c15d6b81f35e9775111f519107935e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.970"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.970_1582648179560_0.8265929666121659","host":"s3://npm-registry-packages"}},"0.10.9":{"name":"piral-pwa","version":"0.10.9","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.10.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8b1562836d8ebe200f81a15197b0305f6760fdcc","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.10.9.tgz","fileCount":25,"integrity":"sha512-W7J1MDc1OH1m8xgKh+R/0V07YBYzbVzzXp04mzEE/25c/LCWpMQipJTAuBTfVRvE48HaQ1VMfdB37dAnzuI3Og==","signatures":[{"sig":"MEUCIDAklzEH0xIoEbvnByo/AHXfKYpFqZ+y4gL0MRf1EPu8AiEA1/thgEjZCmDD7CpmTQglt6esooVGpAao3E6PMUgh8AA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWPrgCRA9TVsSAnZWagAA2EgQAIq6ssNpNqZuguqHo7FN\nvqDJBI6RMHgjsNbvdXDirnDfMRmteQPw/CPY6cNwQGWXm5tKIORoagX6I5Ot\nirGKWY8gYS2I8WQawbf9Eky17n34jjuPAb6AB8bL2r27ApGESugF2v9fQRcT\n8dXIUZOh4KmI8B6Ywqn9g7iR5aMssxGdW4zpV0JQyHCWPoYce6o8ZUAOECR9\nCOSceWZvgBfUXG98NdEbm1YVsu2OqqrHPJ6VgzsL2a+szoD9MY4BYBXHHDQJ\nir7RTxnhJhhHEtwFMi5UrfJJFS1VguVDcOHm8LnglPnq7iYGhGl7L6587NkQ\noN0dqditKg4AP6LWtLF2/hOsVsIiEB8J29VtHmhM7SYImtqhOA3qdxj4fnpe\nbtJwsHSaJ83MKxVBsMrN0J/lUbQA8caGL6KF2nNFgfR/OI0WnJVeVN9vSknR\ni12RRn76nLylFQaIKdo0N3sUvhbeOzlfzCPxWx8D6e4sCZ8AAVnzQSFediKv\nMmX2kZo8DscOW6YyJc9BKyQymSv9hElwKoyZlBGAWZzV2ilqrw+AB+s/6LFL\n+GHnYgFoLq1OnFQnZvBFm4zbhPp4oQyqgnpcPJi476JVULKkoASrhGuyC+Xk\n3DpGovU88o6Uitak28K0l7WsWdyOsxVq2NhRCZI/l/EJrde3xqfa+Hxpmfdv\nfl+n\r\n=X92q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"0d7356ee8e244ddfcbdc12109856e2fef963cd41","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.10.9"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.10.9_1582889696446_0.9068659977458942","host":"s3://npm-registry-packages"}},"0.11.0-pre.973":{"name":"piral-pwa","version":"0.11.0-pre.973","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.973","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a27ceaa2185cf824acb6f40bc2095015a8d3f994","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.973.tgz","fileCount":25,"integrity":"sha512-IYuPu21ehlvBo2eWd84ueOd0am2IUXsQoJa1wYlsfe1PwnGcPFubghQgWSjY2KnwgdnAdV4ZC0XzKwmh2ZlPUQ==","signatures":[{"sig":"MEUCIQCTXEe2nahIx6NgEE79s6B8JE3H/Vu36kGh+6u0Ezc+RgIgDM8nxYPzt3wqX7DB7mf/K6+SJrf5D/zV0QLhN+asL8E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWTnWCRA9TVsSAnZWagAACCoP/RfMbsJUJKGu7Tymnaxp\nr90acyhmt3cnFZY0mrGobIytXj4l3y79qxwQJ2XtWQRSO6UTAjQ1sM0rzaJT\n++uVMy76L57HtMOVwLVcma1A4tjlYOSD2aDsnbzu/landsiy6tpP5WzyAZuU\npdlSLsV/grOYdL/qZkhYCv0+HzH34Ao5s+H9s0XYybl3rjCNSXgxwPHYYVlL\n/7mE1n9A+ZYyXV7EPpPxfi7g7O4s1h9WjWFUSdHk0bL/v1kczFGRqcdg5o09\niBCxM2lnxL8cawpqzK//8rGRMCJ5gdLWAQijw2pokPgUIv64KxwYEibX8MSE\n/y0zRuJ0i+Urk4tAh+rWtnLc2u/uZemq2QhvqeTwp1CncqgfVOTYKcRA6vZa\nk9Tp8osmuAlgeyOXTXGrCOUMW1KImLlNWHq/FaiDMvNNiVViP4ZWI4hx9oC5\nCnHTziI/nu6BrxjAOn0S2dlju4v96tgH0l2AwdyX9vWH2dSJLjQTXbYW7SR2\nhm+tZ168H30zP5vVyJ7Y/jv5pJlJbjPFvIcq2lLso8KVPrU+2jPhzyguKg7F\nMj5NjR9/k2MdzBQdg9nHhfiQKr83aoAJ8nuuwTMidzJ4ABlXNhd4JPGi/8rm\nyYw/VmXcU4WaxZhqQu08rgwyHkwM0jxexORbvb25LOtet5SSrS5IvOn5Z5z8\nzs/3\r\n=cFoC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f7b8a4f8ba7b8e1fef5bd6361dc7744e18fbb30d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.973"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.973_1582905813662_0.2796191859697954","host":"s3://npm-registry-packages"}},"0.11.0-pre.974":{"name":"piral-pwa","version":"0.11.0-pre.974","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.974","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ac67c85abdea0523c93b16bd9a595fd561d4ef7b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.974.tgz","fileCount":25,"integrity":"sha512-WWCLe+TkvT7rRrWk8cehN15AMZYafQwtIGfUWFKV+IuH8FsZDwIXOkVv9cnIMYYgJJwPUXugqgiEQ8kDUQKZeg==","signatures":[{"sig":"MEYCIQDKzQwliuX5lt3nJ1R32QakJkvDcSEwDs1PyaqN3nEUVQIhALOWx1jUhdN9hKzzGD8G3K3RK4Hv4moVfyJ9FMqmmEfn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXgOtCRA9TVsSAnZWagAAxPEP/31LXNy6Cd+6REu+YrQG\n1e/Wxam1VoFmQE49hp0DruOg8Fh3PLJJj4IngkjmEcR/gh79YrxbtUx56FEm\ny5J66SYbMmgJxB2yvI+j9civb98pUKlMG16Hler15m/nX7giT03i6GqE4KoX\ndkbMIBkWCqOloMVdprW2YXKrtY0NvLv2Qhowj4LZmHYDIca1liWxCSe9izlK\nw+aUXfh9rtKMPB+0UBBPijihAZQiaBLUG+dxJ4K1jmnHRtfO4gqKFn8kfWYB\nzwVGxz4q7MsghRufXAP2th0Y627rZ2ic+bamA/Z1GY5wFEmcqn4gPIcWPmAH\n7GgHen8aV1Ik8tsgwClgF+fnW+vLovfQD3HEo0693XChWaM2VRI7T9hZ8Py0\nn8LBotPQixI5a60u7qKWVNYx+5DhW7fBcm30XQv1u+Re7w6Uuru+fmybg3Gp\nzLgtpb2qFgNeKj9lMs2VMs2WY0bQfihiQ/Itd8G+12jyqUfPcBA+/ZiBWzmR\nylOZpPTK5WHFeDmOqOLrSBcbbcJdWTWtem1fI5fr0sDcwg1oGg8UTj2fj2pf\n5SYn17qSPucCZ/fsHkz1fqFiSryfcTHcqd2iNsBBRDEEA4jO1RonTWC8Y62n\nWUHGsKjeMg0j8C36NzklAFBchQLbCs7ExN98jFiu28PuJYD3KTiDqDDt9r00\nB0Kv\r\n=1xZs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a5a59058e1fb5962970e40d1ab923bf69821de33","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.974"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.974_1583219629507_0.7510983883691718","host":"s3://npm-registry-packages"}},"0.11.0-pre.975":{"name":"piral-pwa","version":"0.11.0-pre.975","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.975","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d41d7d037e12310d0dcc069f25d174f3e1470e0f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.975.tgz","fileCount":25,"integrity":"sha512-9cvAW+q4Srr2dZ5xD5cWWtyQFBsa86amwjejGwITjG2qGRL+1JDZz4ssR97kOWZwfDD7qys6jrZzor6N8qFeww==","signatures":[{"sig":"MEQCIC5DK6ubSyglR07qklckTGX6JdkjzDLMwa7wWtkeiAHoAiA0MekzKeOk2a+bb6eSdAPziovLmuGEIeZT38LllnZDTQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXvAPCRA9TVsSAnZWagAAj4oP/2O5xCc482V2+wq2TOB0\nsJdtVTrs+0KfwfpR/vy5mXKAmNJDogvD1TvssyMhn5vp0VZ0rziyHLJW75Hx\n+3jqfPQ1hAkodahE13V1TEdVCuE7kFjp8k2VKlh7ZNDgnd2uZzTm/rerHukX\nKx7DCfVw42BOHeH/16nBnDH6G+NFAqUOLG0qK9Y3hNY9Qy1ijneKIC4EFtR2\nVQwkcwOY8eb82xRXDR266fEOAuv9yMSGEKdhsDlVTjV4Zph/fiE39stFykzp\nfhtNAZwn9X903wOuxUOjqU9YbWLYFMB1/H1TG4oscjsoSXli0nJvh204DZ2c\nTTDZd2Ye7mJsAMddUs4BQwMBbQPMSU87sSUORN2cGqdQrJ7+ZOKWoohyqKKW\n99xkO4Ko0WzZFE1LYxKgVN4teoodaSals9aLRiYks+MGcSXvxzr3pBglcTg6\nfeVVWq9xbkj2Gf/Sd1ytSFhLqB6Deae5x/Jad0CMNpZMetWZAXx5hXjOtOSk\n/tVTg88BhEV0+gkQZStgfEAlWzo+SfST4zmNSGuVvcudbTwBWuRCldBE5b5q\nR3KDN+ZaYLyYBjMoxxsyTpMkTDkee7uXHBlbU/Ytb5oA05RyzBr1AKBfB0Xg\nEu3m4USjdelDx9Y5MeUGeW+H0WoWgPnnvXMvKleQDpNht4pG9xOcAqQ2lHR/\nqN8U\r\n=QAxr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"117ad62fa9b3c0ef32a4e828cb686e91963b533b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.975"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.975_1583280143293_0.3213512766113371","host":"s3://npm-registry-packages"}},"0.11.0-pre.979":{"name":"piral-pwa","version":"0.11.0-pre.979","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.979","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9889f69339d6a7631c8b7b5909a62a345c28f96a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.979.tgz","fileCount":25,"integrity":"sha512-8M/h1KKAJqH3yXVZEk+7hZlRCpuXUx+yN4ff8phn1YYmXsLaZzI0U/0wMGd3bQxBWX3WhpxB3xqbkUzghl4qmQ==","signatures":[{"sig":"MEUCIA7VwQ0YyJmzH4JgJjTalPfRI34WkdrTXvqSnhB0NbC5AiEAsKfJmZZwnT2OKPxR5hWPmJLj36U4woah1MtVf9YVgEw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYYN+CRA9TVsSAnZWagAALmYP/jQsRm804Y9nQaoTNnCe\nncrl1KoPWbn3Wd4zTZMirrrlUSQQ4hqRINbBZiGfdu75/a7n43wun3MdVxOf\nHScbw9pF8jyYgEzCmIvjM5U3sZClobELvWxu8reCBbThtzi70juDWDE7+lbb\nKfA4JsQWcptGh00nV3JA44J0Jcxbq2tn1zCrGIMTDdRLkIWR++CM/Oo94EdN\nTnO1a+C8ZUFg1cW5ykuPikjf7QUQnCfXO8bvj5sQRGfb405uE0d2I07wBNB0\n42HVivhaL59NYAnmxEYFB3LEm4+P/4TAZNQTeDcKBxPPoc1U8ImpLxOmBLV0\nLmRBQ6+3pzjXJ39yH19j2CgECgqk3XhV+hnrunGEzTNJpiitXJ/M4VAZjJb/\nixAvud0UkEvWQkHrHGAIqt9MNQNF7nDwhxK6yBW06YIZhVa9yQZLDoBswnBD\n29fQAYJdXcpvgavzaFfDAUaOkd4prMWLo9/y2/hFLLFxb3iyQEKBSpp6r1Lw\nEgc+R27cdtMStbN30aLC9uQ2ouyctUKhNaJi9RXY/Ow8CECzM07NWU/yMZLh\nAfbg/pqqd6/heCGaXj5eHfsFaSUtJmVPTvjVawLQHayeRJ6An0sp1ULeoR54\ndZhKiKDSvmxWrWw6wGSPvasJhF8HH7GIPBWN7pCsfiPCA283G0Op55WhcOgG\nGYwn\r\n=q90G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"af040b498962a92072851cb10a7d3454d7a09c9c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.979"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.979_1583448958391_0.5319386583217136","host":"s3://npm-registry-packages"}},"0.11.0-pre.985":{"name":"piral-pwa","version":"0.11.0-pre.985","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.985","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a2f0b00eec340c2013a4fc9f2eda7bb09cab4bc4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.985.tgz","fileCount":25,"integrity":"sha512-t5C3tI5YV/oOe6Xp68YP6eyTeSrm0TwENPGQ/k18Gy3bzjBlzoaJtBAKYCgO3exmaqU2X3E61WBV/P1Y3VWZ0A==","signatures":[{"sig":"MEUCIQD1/+R2PLTPoyfIXJQTTGULMB83zPudVkKMZTfxaNL/9gIgaCMvk9orpGriioBrYc6f3Jydoxnc3AcyreLgYX1v5sc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZkMCCRA9TVsSAnZWagAAfDwP/jzrS4k56rxYaMj/4F+y\nsM99cGEoe8kKt8FS7jqvZ917CpX++BC0Ejx/+CuQp2MAnXPOcOLzTDrO2Py9\nZJhUUFxSE/pyBB2GzgPwTt1hE91bxEAmjYSVJsf3WYTPBy7ExAVJWDqP32zk\nPQOQibN9TRZ8Y3hIjH9LXymr0RoDAAEOcf0SG4e/1e6SbicV/KPWK8sjG7Wt\n4UM/YhclKiBebqpq/Jo/sHVo3n7E7jkEyzxcDcJIZr1XsxPaCvYwcx+7GVhx\nDV/2X48ywFJIpzo/9JtJeU/+tdmDwSY/kaTtwt6rMR8Qoj87CoWqUmCQ/ob6\nOe6xUxESWTEDKXv6augDy/sHhxLwqvi4ZjKR0nXp7sodlnylK/vexo9zRD4r\nBEj9opwch/KTivd7UfBd4KVDQVSm4jlr/CEmKtN+BMObz/c9aqvQXzZ9I2l3\nusEEHn52O0RPPHdg9U4GY+ZyOoKlMHG3YpvXdGQwbdvLT94UIGAHrbSdvSvk\n6URPYKTh9O5j7IcTy5PVdVoeBBSZiRjiDUzkCsSu7aLR61sGfcI4hLS0gHdx\nNKduomQfqhW1RDwJYe4E3+HmW94M6e1lvge3y1ULKYDvX/USkpOlmM8ZCVSR\n/R7JfIWQm4Y/vBF/z5ygehZRKnELIDa0q1gj6Sf8Y61ruDM66HYZOhlvuCIj\nwfcU\r\n=u1bE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bbe8f6adc85b9ea172b23e2970c6574e6b0a0462","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.985"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.985_1583760130271_0.06867279718352703","host":"s3://npm-registry-packages"}},"0.11.0-pre.987":{"name":"piral-pwa","version":"0.11.0-pre.987","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.987","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b48c94e198dd5a4e55a681f2a524762a1cafb799","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.987.tgz","fileCount":25,"integrity":"sha512-mIeAAGGMuTRAGUFK1IXfhGMWTRCnRoj0cMtjD5rn6RcFzMitu8yx7LR+ilPnrX4fUrak6OyPd3+meTtF18tgyA==","signatures":[{"sig":"MEQCIDkiYM6507lTcZo9AEC12ZrXJdarUQEMynYAISA3cP3NAiBChK0GK1nYRYho6mrjz3QLAbaOEepDfrloNIbJt48LrA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebIIACRA9TVsSAnZWagAAlZMQAJbzgJVUhJVvD+LVR5Hn\nhxSyAC3Ar+anSWCqPfYSYJnrPVbdI92PnLwAnnNpxpTQM/eVpoXFO6p/Q5s4\nhJ8aTzmnNAOXCQNKDHgcJtg3Os3eTdF1xc9oXWISVB04P6vQoF5OdnP4+OC7\nr0GaYjNBxHAskBQKi0kGPNB2T951bBBOptSzob0ECUs6XCKPDb9I8c1TyHeN\n1Xq1THGMa7M9CV1AnUIi8HEbp5NCJT/axecO+q87DybFqDK0+0M5/dPzMTY/\nx8NY1/1FERfTVZ7JSXVidOU4dnZoeWIngbWPNRng2K4ObPtPz8o+kwkfELha\nKouuHwLOECF8x/aqQuQo09EJ+EYPU0y1Mssc/FFonnHGSGND+GX6FNq5mPT3\nSmoCBhj3kUJY0QLdDC+CP8tUNJqrLviFNLl0meNAWHK80XmzT5hp1rI5On0C\nDFVfoZXWz9w2T31Xx/TXpLCWACVO6QW0i9349FiwsMQMj1VA3piDWGa6TT/H\ni60sy27p9cS6r1HamOHHoMZAVQDEoyCSMLcborhTt2vVDRTCMc6lvxDhYVGl\nEl/+YgF4on6GsWc6arTRh671nt/Vn8Wqbx3w4aF3pk7UnZVV0K1YASEYbe3o\n+80rcYdUh37uDhl3pY3pKR3JaLx9lBCEKYeWMJXKeqKpIdoqf+oEacePDUab\nVlyI\r\n=IcDY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"633b65eba4ab9268df82c1705339a44ce087f923","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.987"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.987_1584169472219_0.5701937891772895","host":"s3://npm-registry-packages"}},"0.11.0-pre.988":{"name":"piral-pwa","version":"0.11.0-pre.988","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.988","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"82589041d135517a55afcf3e87406023f3d6a51e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.988.tgz","fileCount":25,"integrity":"sha512-ipM8gpTcodwv68/8mbUu2ET2lGwe3J8U/qjF6uEBWUaXsKiqV96dau4BYAnZ+1TzP0/f5biW4KueYVF9mg1rWw==","signatures":[{"sig":"MEUCIQDM1bDqCh3MD3bmccpxvXiRBog9EQnrPFDA0yypG782EAIgNh2HeajY0AegA0ec02VQ9FJgVgMndA9BV8JrR3a9Sh0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecpJ+CRA9TVsSAnZWagAAKVQP/0YKq7HGnkqafs+dAx0K\nw4XbJ+GgYjL3zVK6ZASqs5iH6iLLou+BtQwuGnbeosmR5tEL5GAbktl2qfo2\n7sgzD36Y4yq6VAe9IC6HtGkbyMDNjtYGf6SHoI9yBsKMUro8ZlV2qMM8An0O\ntb/V1C42p4NVCcbCdgwusCt0Epdd1JirMemtTJ5oiglXGyDAxEUrourptp6m\nKYzn6fLmgK3qaKAmFlIbu/61e2PgTgo9Bq1qPnFblAT4hexlkIFljVm1zosv\nt5aVer1cBIIyzPBV3DabmQ49C6izZaDslZRkHb4O4qLg2VU3VGoPFTfDayDV\niDbcfGoAwm54zvTKoToLQRRDl3IKpyXUoQzP9YukNvXH6GyGzL3gsAKdpZjw\nOBixsvfORo+pa1amNUOW+yXvwXpfo9WH+VzLPVvleyox00HIV30K9O5AtoSw\nxe2EZIMpcSShNePp0OwpjA+aJqonbD0GBJu7FEKOx1hWqZaufi4N+xzczSHd\nb2UDYf2I7vdqVoodrjYG6gvxG1qrtga3bWhGWKhoeOHyseescAgfalwTNDAT\nHB3BOP4OSAFgDqpY8HdCQrzzE/ATSTKkF55wQQ3cHTpUgiawm5uZiCtyHutx\n1bnUSxm0aIJlRRMOP6aLsXofVGHtVxWjlxpecGKhAtJsj4T6idbZjnSpBL3A\nQTFk\r\n=o9t4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a7462fdb36cf7e7c0df2f79b1e3fb3b24f3334ed","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.988"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.988_1584566909591_0.604155759907917","host":"s3://npm-registry-packages"}},"0.11.0-pre.989":{"name":"piral-pwa","version":"0.11.0-pre.989","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.989","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c2688d68252e83e51832eaa1df5ce5a4574f7c4b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.989.tgz","fileCount":25,"integrity":"sha512-6zqMhSwAOG+UvKSn667HjHG/hNUHpSF1/iBMbPIBjEcrUbhUDxjIGEXDeHaYoFEBL9bJ4lAtHLD6eDntyecTkg==","signatures":[{"sig":"MEYCIQD7YyHtZKgfo2PvB/p4OiirETbKr57NM9Z15dpJP1S5dQIhAN97LKedJZRKOu86OewoFpQd84mblmoAx9XyeG48kMIk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedKupCRA9TVsSAnZWagAA6qIP/RvpU9aY4Nl2UdiGf4iy\nj7aEdXBsoPMAQPZ0xHj2IEqqa8lmqoFOQJBR6rU3ItOd3uplqJ8eNNr3MhIx\nLC+czqowVyXpTpP8JUj82DoJdVxDlUvFr6E52Mku5LsHK4jb+TiIzFFCXAcd\nJDj1hrrq2Z7SN+RANoaujTG8CtCyYsL0vszGm2TbfAVlGJ8aENscW52+7kYX\n4EtORoTG5cWsHKki1w8sDR5QwhJFXwoIaa9RM0Rd0RLtoNHUYqKgxGTc/t1+\noilxlTgV5UlagMQy5Py+ddji0zr0S6sxrgeZqOqhwfL8JW1VN/a1omq1t8L1\nGChc6Y8S8p/wSCwBdMei+UzH4iNBnTqOqXj87Ke5e2DzhevIYWgKcX5UuSgE\nPjVK4+okbYjxj+ssjBlgQpT0wsXS9TZmPP2TTB7fjCb1lZ8COxhX6CI/5UhC\nPHI9cQudyu/U16CE3lyTtk71OUaEhwt+2AsYiAWJNR/OU0YZ0jwv/GWgveb8\n/+Y2geHlEybkjvdnsgN1GLfrIDRiJwBXQE4ehuP3IsOypUpLuNXgeYyWOpnS\nRkFLLzCv36TIqpTRQqx3f21vIXR0TGiDCfY1P3IThtJP+hNMSxClCgcgzcCH\ndJFWjwvWJnPenLKIRMuW7I/wSmzG4Tr5N5/frnAwacgQdO0sC0yD3wCfJxQy\nTNS7\r\n=OM9q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c46659b213a32211b8676196dfd1885bcc06f55b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.989"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.989_1584704425390_0.2534306938402682","host":"s3://npm-registry-packages"}},"0.11.0-pre.992":{"name":"piral-pwa","version":"0.11.0-pre.992","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.992","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7cc6df7687299bdf6b41a1ee3bcb74b0b361dfb3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.992.tgz","fileCount":25,"integrity":"sha512-nk1DOyUuxPCF7wpNRDKac5E8JyVWLm7usa7CgM5XRDYfz9YyFQ+Hum1rFIwHoLPXG8Cs1AJgV61XSR+6SRYf7w==","signatures":[{"sig":"MEQCIGv3Ec7MFzSAC/Ty3WR9FzdWTUdRmD9/2fOBHlN+QV8DAiABAHjuIaMGQOpA6Z1SORIgmhOicuo2tNMO9lwSv9MNIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedmGHCRA9TVsSAnZWagAA7/oP/ihVHmyY+Rw+0EucIfzU\nt5ozqkJ9q5/KFoTyq9vGFKKke1JMM8CZ3mxnyCVGmRopRHIQ3EURVkTUoxbM\nEBsE9PxiriLNtHeqvjzyR34vZeF08PTzzQ0RK3otdvr4BvaD10ltiAW6RBfV\nI/poSKd1LNlyl5x9GR72eDecmzyqrAMlv3kn5gJm5IBGgRVAVRVyHNsfaRqq\nxVlS7F63dTw363dBBsQ80s6cEWxV0uZdRF9w2PmLNp7mk00TT3Z1KZwW2Hwn\nmBpvHQDLPX+QFPMyBmCwGuJEeegfYXRTgWu5oU2DXItyOZ8KXni5FYGU2sHZ\nNK0/Hh02l0HEqSuxGZx/gyHsPfcH9clp2BzhS1wPXr9BU6laRBlfpJ2YuSGS\nYGsE6IQOdM/D/yMETMKLtUkqCmODrbDHyVixpXoAMza8i4E2x+j8b6dhTQeD\nMyUMfe1bPhaGsMsKSf59dDykqWtUfroYFiXVEM3ZO2RTFlTKxUYaIPs2Nlon\nwZNzk1096m+wCRV8sBg3KsxBoApGNzuPmDe7g+zzU87nAq5hO0Vz/U5VN2WO\nwCa7HcDkgiWpBNYOUoAVrVCTm8c7I7KsKdB8XFPINOgBsxCQBp+VDRQh/nYX\niXMYAVABcFPAIYrboEGE/pzp1pynsfU/C+0nHjgPr8KXeiya3MYoPUBQFRqg\nj4ih\r\n=N1TV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1bc857ce4ee178e56dd7cf7468af180411384aae","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.992"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.992_1584816519541_0.42232856201417834","host":"s3://npm-registry-packages"}},"0.11.0-pre.994":{"name":"piral-pwa","version":"0.11.0-pre.994","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.994","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a2fb1b6ac2ee5b1134fa8e2b342de7daaebe0947","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.994.tgz","fileCount":25,"integrity":"sha512-iqkF+FT+SdV01ktSXzsKeo82fN+BV+wOGPmxmlpX1UnbVw0dhZC4ZJwwydZ89K48hUqNEI4IBOE9QOLViL5CPQ==","signatures":[{"sig":"MEUCIQDgl9S5RS9FOcxNdQAAKJOYItnhHit3QCKEKODmP8t2NgIgEqt9idbNlzwADKW9fhs/YUtc7ZZ1AsVm+qXENiS9fU4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedsuCCRA9TVsSAnZWagAAUWAP/ApE+4UN605g6PqhM7D4\nAmCFiZGdyab7jyZW/u8V7ekfKkBp6j+DdjZyz26VR2CZT5HiO+TU5fJYxGto\ndaT6NweXicsAl0Xtg+hmGsWHgDUhLD78raHFovHL5pzESB72CmwyZxPX51cZ\nCYcYiSf96THGiL2kZ4GHFaI/YUdzGBt+UlJMf4kQFSHEYq10zTPPyOUIGhdt\nnftYHfO8AnJvFilCGMw7DnGVFbeSchGUmN0ILMR+jWZPzzXU6wvbEHxFJAOE\nmPmLfQxSAYd0FkB/F3Hltp5LtwQNj+Ju87Le/Jut6+kL8dmYntQG3T4BBtXB\nfKWt+8mmVQZkI3eojJpiTMYOo7fSgiMw+DzkdK+SOnYsbAPrsngzcc2F+Ato\nRSmLGHqZLCcD3nJKAzeQxhehKTsytow+IGNXbF2t4KzjxfkEetCXsdGBPvEA\nEQA8nhTi4ZfNyZZEZE3eVwLC5QRpjxaGU+HXS4fGVfhd9zLkTCEYjwAOTrP3\nzgq41WHmMq6C6na9NoGCDzcQHqXV+JGt+1YiTb+1Zmcv868Q2DdNPKo7OAXe\nOSa8Nmq2cnKn13Tu/Mye6TAb0Ns0NP6VckTvD9Ue01DVwV78tWbyL929V2qU\nbIcBxa5k8blyhAuP9zgUG2UxgR10y1AT0/L3zpnMfmn3nda0eOvB9tv7gaaV\n6GYz\r\n=Suyf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"07210f348491032579e35b6eb7bde95ee8047e0e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.994"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.994_1584843650403_0.8836593154817383","host":"s3://npm-registry-packages"}},"0.11.0-pre.995":{"name":"piral-pwa","version":"0.11.0-pre.995","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.995","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"60dbb39f10b5d191ba2d1866bc115ef4fcd80095","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.995.tgz","fileCount":25,"integrity":"sha512-EMs4XuPU1VtTDYtFoiw4+DlgQxftYji6Aj8LEBCn70iVkR2swB/aiTDVjtLTYDCrG54EBXZOoc1GZNGBAxGtAA==","signatures":[{"sig":"MEYCIQDz4Gph9obwcSAzK5Hz0xfWwO54VuBdMPS3Otdvf1e4QwIhAKM8EDXPi5OVX+rnhccicdAQ9gQLrlOap4BoL5YoPSRM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed/G1CRA9TVsSAnZWagAAxP0QAKO5tjWpjCK35LMf8ODX\nnmTgWpuYZu45LRjnuDPhsezPw5dUgbtD+r1+9J4OPE7v6Qd0aWlppbnD2m0y\ng469c6mklgdBdI82M0rub5ObBupZD17X7WY4i2udCoG270nfU9GmYnlG+JR1\ngMB1ngVB3qA75eh3fG8a3i+06VDJV417wZx2B1QgzZHni/kwuwtFglXWVCiw\nV8TjT6Yma4lvP3M8UD26mcq5FBtSGY3Q8jXph4Fs0tdfKPqiMVlPc6kji5gK\nzmId9WhyOz5nLUrQoMXGEtROBD/W5J+kwxqASMprl/qLCDGanTutruB31eOV\nPCz1sl6uM7j+NqWrXrU1o6Gp+uIbGDA5qr7FrDEJMwr3ymFiTDVtXUIUBT9Z\nenESgrk7AFzYvXfNN1ghJSlIhvQq4BxdYSTZKZK/uGiNHFo7pXnXI/ec1wCZ\nrNNSf/bQdjopT2cNn57PHO2FXiad/yHtKdprURvculpy+W8BOh3py51rbxi/\nbaT8tL1DVYLRasl6QdQhXa/t7URb8HSllIWnFlIH30F93tGqO6yrq/3a5RL9\nWKp+IuUc5lr+Ea7SjJpJDq3efUweZw5p0kwF8Fq3WQW1+SWUGoTofAKESl5f\nCTeF5bifcM1140JIZW0EgMrjBE4w9piPzVU48aHSIIxJpQx6BL7qK7VR5Ii7\ntgIb\r\n=237m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4ff66d3ac1e6f31274ac1487d56ba63f6c5f0004","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.995"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.995_1584918964565_0.9127671802918198","host":"s3://npm-registry-packages"}},"0.11.0-pre.997":{"name":"piral-pwa","version":"0.11.0-pre.997","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.997","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b07deb71b0b42f5beec37474c73ace24c5e262da","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.997.tgz","fileCount":25,"integrity":"sha512-aS1umOIrpesmNq1efe3Wwoexh9o8MaAWzTvgJPx/n6+/4T3+LInghtRJzjaxrgYWzTqOsG70/YVL8CfuwvRlvQ==","signatures":[{"sig":"MEUCIQDTHGX6MivYjgtJY9hYdJZu/R8+6h2ViLQJxgzfOxzzOQIgS9VxWfX7rzDjPaJKL9cR3Y8Bb/OThRmSDimNuwTAVJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefUcSCRA9TVsSAnZWagAAEmIP/RcrBG1WAJmr3YzkKLNT\nfHHj0AGaEhXVs++rzPPqAx4sNeODAkoxTDmwgNAnANopvYIihSUii41hWXWs\ni44UuJ5GljDHXnBumuFlHd5iVmyK4fTq0D4CMYroKNQRuwPCihzPU5cUK7QY\nLJZeFr4tdrY1a6CtHV9CBBJt+sJJT/1RNCfNuQnNGC2enFB3R2OaJve6uBNG\nqUW0aNbBB4biGoy7JQEv2SZZHZqAnYiKYsHfKSXkpQgQV975/dA+ku0Ho6qj\nDAZ4Ef2VJ9a5akpReNmEAL8Ai8KWEvi2ZxmIUKSi7UbTYuxwYo65lPNjo7v+\noIeJPQvcEzBo2qbrN19fqU9i9tRV9lyrP/yy3WyKU4kxmefuey0Nh4Px4jp3\nqGlLG427hhLkMQv3lSUoAQ0lEzPsfSIHIfxQCPpv/Yrq3muMTS3e5i+4MuP7\nIxWasDZrbhf/vFoWSRn2r/a6Yi7uvgg/nB25yIMMeVFIT0BAAs3x3/wOOLFD\nR0AJXbQC4SwkBo0BbJeXpXcBMr/y07RLs77Gy0CzGpO9crrDEQOg43KM7WfS\nmZJSxr3/sd1gSUZcHjAu0xC2AdsntuUKLP7uKSl2oM+kvE8sWwZtEx6fKt4y\nGjbrCttEZXTM2K3YElh//1ZzhfGJYRDdTekBkvLwUIjfahsfF5t+Y58M6WHE\nwcBd\r\n=+T8z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8aca7104e7ec07b937305210339e283d29b0b518","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.997"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.997_1585268497642_0.7289405138844887","host":"s3://npm-registry-packages"}},"0.11.0-pre.998":{"name":"piral-pwa","version":"0.11.0-pre.998","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.998","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"adb3121c594150e2e5eef330f45536438848554e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.998.tgz","fileCount":25,"integrity":"sha512-1XN9EHguZSX7bZupLLuhei+OSI1MI9wYvrJhu4khJakflARY7tFDf8WrMD2v8pG15PRALe+3i1UUudrENUCgDg==","signatures":[{"sig":"MEUCIQDqLTStuhJjHe28W4H6X0mtBFNqcrb/Op4Bd/i8MDfkDAIgQMYOD9aA9yAhrm2gQ3hynR4Qfenr+I+FVxn+Bfy2vas=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJef/+zCRA9TVsSAnZWagAAcLUP/2Yp2YgFj78AMP4tQEq7\nBOJ47/c3cChefxFZjprAcaVkatDYkG0wOk+5lsYZys3IWXJqKzXtxxPq1XLN\ndjTFI8TDvswCTonqXpGSuO5whDh0ft63Mf8DOFiJuDbEqbCg2sipIYdG+Scv\nrkhe5VUB8ehZNiBpmFtDWUDrNFDZSPGfHX1cGwIYSDdFDXqDDDoyUMwwEDq2\n9lfTzWuNF1nxdRsGRXXN3QRWw/F2q/76qde3kL29LLf4p3Z7k710V5b/d4xB\ns6ySy9SkXn7hENchgHo7pc6TH4+WucpeI9e3CUaJNYHvCBdDGV8EzsTCre4C\nI/couF4zLyqo+Ll9uwSLo2G4uJDdl0ctswxQ8D0G8WjcFlBwf2z3qAHsKX+T\nmYYv7HZBWsBsuI11m4gBwkruiRqbUL1RFJmOd259V5lbVzmyZk8Xd8brSSvB\nmcHABv61To+zoDsbbFopCSKA3J1m8w5FOCwzsjXzWHXZZuC1ZErl5mvMTxjP\n7J1wF1QRinLW83AjbLQam13oTJCbv+iTtayHb2/auEfjR/DPJ8Kkb+zZyIHP\nfizBSzG28rgzO0PwRtXAN4Fvp0aHeoNsJuPbdf1E5BosIicekOgaly7VGOSU\nCz9g4j0ZDdWtpfh8dIueGvwrxqRnZg9961lGFvzrRMYf3dMQLfefX8xSGit4\nmhOz\r\n=k6dF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"44884607b9a5e693e13201161b19f586834e3b3b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.998"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.998_1585446834948_0.33041932547556896","host":"s3://npm-registry-packages"}},"0.11.0-pre.1007":{"name":"piral-pwa","version":"0.11.0-pre.1007","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.1007","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b18c9600e69816dc5b7ea178a53a7b02a21bf505","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.1007.tgz","fileCount":25,"integrity":"sha512-nsU2Ds9PuAtRdAfZ5AI4GNYwqcpAMQyuF/vT0vL7m7NtFHoS9dPZJfCpqJu0IotWwMib38IIrlZJuuhDqaRRjw==","signatures":[{"sig":"MEQCIH1GFbWcrO8JY6jyAXuo0lA7MYgh0GD5zRo5cVI0gfDTAiAZgt3E5TXu1jBLH3E9zjJpmG7SzAe9TW3ex9Buh8l0Ew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegTQBCRA9TVsSAnZWagAAoLkQAI+gCCjrR2r/2FKyeDkm\nGx1sOqygDIfOiu6OHKg4Wng55J33vG7/JT1r5kJanb66Y1k4TBBEogKrkC0F\nGYAjrngUsqJxP1ToF78gLNb2azMGJdwyl5GMEDB+6hFf/iYAo+c+estZEPKf\ndLDUOwX0YosdEitWlhol+6Gt/cPgr5tFU9FFGN5lPVBpnzXm5mY/sTdQ9XpK\ngOj9KpWmXKIII5aY4Hdig56fuR6QA2PhAGSKuO78qKK5NbZ88WxSMt1xJ/jk\n4HpQmdxKGKifQseONqmc0aWcPhs0eE3x2EVlrHhCvcEVdUbHCDYdXilBtVm8\nG1eO1Q/VlSsV4hShsxI1q+91wDXgXxKdpgNbRfRWltfUaxwgohWITckQtkVU\nSsIYkABtq1euem6VlHbYOEEq6/0QZ9BcxGDajah+j5gVkuPMvLfycwHdXukg\nXqcPbER++VhKqGNGZ0GeBeQpAPclNijKsfzKRCM8po4ibE4zwpXtfnHUnVrn\niE8bteuxVy0U4jDclSjDKzvjvlW2yNjC8JRtt6MT+z3x1VE4qZdVnG00DOoR\nYXngs0Rn7ey6KY/vgG1xFyyXHhVVrCMOoHANJH6MYPL/coN2DWUYBOBx5UEd\nshvMPQVQildJ9sjOGrcpU8jSkGHXoUAMKEI6bQyN48EkSfMPgil0JyYV4c+q\nR2qz\r\n=4I4w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"052d043f9755832a38fb5badc61e4de2b4fd5e91","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.1007"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.1007_1585525761133_0.5896940193414089","host":"s3://npm-registry-packages"}},"0.11.0-pre.1009":{"name":"piral-pwa","version":"0.11.0-pre.1009","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.1009","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0a432798460062886dd0e8415685d3ebfac612b3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.1009.tgz","fileCount":25,"integrity":"sha512-0nmHRtn0/63M8Mc2MDDq98RwMaPQJwfrNTdmdPMTi1q4y2BvHWbtFo1Hgf4MKdQNLKYQ84KZN/TB/FvBZSzRRA==","signatures":[{"sig":"MEQCIA1ZBrHSAqOjfWVyNdER1e14ohAzVAjS2aJulDGQZ0DIAiAiqnJ62BRl/Pucshe/1qlBTS9TfSSGXMV0BZ+MlaVdoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegodUCRA9TVsSAnZWagAAwr4P/0iEFq/WAin813nCRbeV\nTlmmC5yoJh3FZPBWz1N67QmstAF23K1ufl21rE0tvjI6L2WPd82aefzjQnYL\nskiZ+XrMfjnbATbn94TZvCEWGDrTFeuGSidC44HEUJAYQ4KsnttXHYEXvM83\nUjPvxe+VrIYw3CdyJsN9GSI1RVTBlbL3EWxmvjqvWhyJS+Dj0xQxkbZyHv1D\n80bw8KJ9cczTipY9aNHYwa7/MeiBjqoKbfeJsnSxyhdfu2fBxUeICnsWFNeg\n7SMcgHmBe52LbHJNP5Ryqta61I8wAy3R81XLCrWnT3h5j9IH/hzPbdhCNsf3\n5hd28nZaMIpMbmZyZfC18ItNHCf6v6M2+R4MZyR8Tnh7XQvuev/lOMof4yTR\nHXtb6Y52yoWCgbuKFRtsVFAfOJjFdwOYgsSoes3vmdlOuFJngvAmHiAd+gke\npg/DX0zrMaejaNQohfKz0e2jA8QbjHU9a+hEgRrmVqUwtgam636pS3LL/mXG\n7O9ji3QW5FC726bJ+3EPxNsGlChPcs4N3V3jv2KfQFz34y52m65CWjzk0l0j\nUKl2QL2o8Xq1b6OVF+Q4SsjWfFEVuRF3y5XKJyOOues2O5dRL/+T7ksRZEPR\nAwzLDD/E9ZjGu3VSpmZh3vzSBqjFahPSaKR2ScI3nRYkvIKT0mocxsu+IFiv\nio6v\r\n=lXHJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1874638fd56835dc825f7faab3513aff3c8ddd0b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.1009"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.1009_1585612627855_0.8073660303223682","host":"s3://npm-registry-packages"}},"0.11.0-pre.1030":{"name":"piral-pwa","version":"0.11.0-pre.1030","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.1030","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3264f23b36205ee5d3c39bd5965c3b3fd7d8f25f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.1030.tgz","fileCount":25,"integrity":"sha512-Aa5QgNkUphdjhNsmBQavhgocwnb7FCUGsBSE1vIWUdyRotVweVGzUbduzPNo/1IcE29beizygTjOPBpNV5EnQw==","signatures":[{"sig":"MEUCIQD5Ge5n/82bKFsHiTyVzvW2cW/ob4UCKUsvW2AG5lxK7wIgeaKNi0P7xxhkYlTCjBHyuGTGfg6d3wfOtdp9Y2uE0ZM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg1+TCRA9TVsSAnZWagAAqvAP/06wKRdNuGbFs4L8+z5K\ncJ/OTzxSsqBGviZfpvkNNhFyNgwhoOcOotP8KiVpy7yBhvPi8GotToCZfbAa\nKxamfWmL5lpNFGwA+AlWhKq3W0giPTM3mre+DrqFkZ/UAwahFovNz/OgvlYL\ne+Af6b5fe/kaGwzheicZ/KHdb4eBUbV/Y+nUBnzHYw1aIk3+OMOI7tLqEvmq\nLkkCdDp+H3u8biGPKGnU2pyXWk+L8TpvyAHcsXUEwrGB21cEEpUIf8mN1UC2\nhl3hFpfaF7VQIkpMkBXXO2oA96VncAznwm64kJOs/Oskt/W6lC9K6/CSbrNa\nglzyTbT/kO0essr+TGbDN0RCjWy09V95kJkiPoh3/p/S2v9oBl/sMApBvhzg\nZSC3T6B8jVoWPRhBff8Yl8c+mQQCIOAj3pBzCySiJhK0UxmQ8QWnwZWWIMg0\n/im5OWcBkRgSg0mSoFhsEeLs3mKYbYTiO9ZvEH5XzjMXc0+i2gRzgoIU4yAx\nWSaljpJQLJRvCZRZ+MXYTrLvhajdYzXqdlSe2sncxjwjV91AlNRl3XA4ANhf\nV0xsTrssab083eJmlHvhzLJqvEeiS+XCcexMjIouiLUHjS7lSii5cvgX1/Ay\nuSl09dFhkoRicjEm1MONCaMZnaVmVEydkcFgOA3G4eY5aIVOxef53ht/jbGC\nQCQS\r\n=6f7M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"07cd6733fe26694c4a90ecf582b59915c64fa72a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.1030"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.1030_1585667986984_0.33295971808329083","host":"s3://npm-registry-packages"}},"0.11.0-pre.1034":{"name":"piral-pwa","version":"0.11.0-pre.1034","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0-pre.1034","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b0892a5ab67996497816b058390a8892e3fdd875","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0-pre.1034.tgz","fileCount":25,"integrity":"sha512-8X1qHcvfUh4J3q1uI/KfurbabE+H2aWashuIf5sst/SjedKhnQY9Eh8SK4O5EH0F5oOqYd+6yIehr49nF0Eb3w==","signatures":[{"sig":"MEUCIFlX3vS1LNpoW2g773rmZwFxrOWZvoMBmZSQMDkXHXh2AiEAoGefG840Fw4sdBFvdLouE/f+vF+ZzNoLY19lRn7YuBs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg5IqCRA9TVsSAnZWagAAIvQP/j011fheGnMi8LLf3b8Q\nbghzb9NHt/pVA7fTXN+25bMA6Q0pwD20q7qKR2AeBf+kyQZB/ppyAbrl8dhX\np28VsgInoD3Ufpi22CBvlEloRQH3zhWNfBEJBG/MdW7fJmV3U4VKMeRkvN+M\nmhEAdem6gC9DtkCOgule2RHffoRZnns1v3M+qhlwgrLoEIW4Rk8hjCJbBNDI\nQRug2VyH48Q0xMbRezUGtctUM9EJJpR6858z59tckvrAMQsNslJLsnpCEFRt\nu1+wutH2OVu1pJAkXTu27FOKqFyHtuiDIBTGymED9kJk2u2kn5bW1esn16AC\nh361puKuZJ9WfHilzWBAohm68abpKKSssqqbZ7hhnMqYlzUlKU0NzkoBQYVs\nSWO6s+tZKObjkY4vfrjT+JNOKY7EGHpTxCp1uHjGo+Pu4czjD13BeSaY0qMA\nfGdRel83mulJFXR2nYyl+PzEfhy+oqQg05NQVOpARpnqyX4h3wxXlYFfOdBm\nRWAjRLsatgbdRupc4D2WDHSfdgoSBkOygSeabIt7CbexzWfRhvO7gzVHJWR3\n5acZmZEQs8Nu4q/tlTVOj+3Qk9OtGHxo22tJ36UD5sX4aU38EmrnoA8MHwbi\nxA9F+41Ib7ka7Ji5DmB4+tEGgbcRiga8jgKXJ+Om8mYCrVjIPlT/GJPKvjN/\nerBv\r\n=4Yl5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"035e37243a04ddbdeb0fb918b3ed37086d8b8ced","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.0-pre.1034"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0-pre.1034_1585680938584_0.6085597600626842","host":"s3://npm-registry-packages"}},"0.11.0":{"name":"piral-pwa","version":"0.11.0","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fe67863c06812b71244c4734fe1b20952de8a9bb","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.0.tgz","fileCount":25,"integrity":"sha512-Nyk+B9gQtiFbCxOOhA/q0eKIeA9zMB3afeYf+4wy+C2etTNYdd5s6ql7fxt1yydNcuHjBsnj6VOE9ydZpdeJ8w==","signatures":[{"sig":"MEYCIQC1PXv1b5g76bze0tfzgVpBiUFbEXkPZhi+/ppQwiyIUQIhAMVUWedeJqBjRmR3Kp3Zqs+XEd/h1y+mOeXEfulFmOgD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehC/BCRA9TVsSAnZWagAALcAP/1v4AKpVzZigKSDq4bux\nJXd5OirYJyWAz9LuWWgkmNMjV1hZLnx6ZFtRST7VHDuJlMRPRfZZlMPci9FH\nrwVcCCnNqcBJGhuE44QLjafZfkCqC2RJn9wlJYOO+G0BrrcCvMury6cmmRz+\nGHl8M4HP4VD9wuGLKGMwU/bjBCZLU8KsibaoOTajbWJeTNiXzHBQdQ6o6/qM\nYqNf49h5w2geYRfGoDftp92C4Hlp74mgjOJ6Z1NLWMKdsK0hJ9+5wLVdoVsf\n3We33SHCtIq6yapQANRmRJZKyOpJE0c219tKfLiT+bbDqo8SGJHx+VYJwmyb\n+qC4gn9sV8QyiBbidCcmLvHTjzADqFm0l0AAi9v8pI02jk0mcB/eTH0af/IP\naRUhVFow569/lCWjTaJPUjZQiUAbYiVIAbnpqcZlWfygJZp422PGrIDkGdGd\n3RGQ0cZ1N6CX9L5LWyvkMRidjwkD2h4WnM2WmxZTfxXLhuVRAVDGmt/25+Ry\nlZkHVrgJFCQCwFZYeqmu/f7oqZ/QQpto4hZiKEbGR8UJD3ndzAhdc1ETmGs/\nXJbVUP2m1jXy//1uJDPH/zZygTBvLKnesZR5KLsgUBySAkt6t9iz3SegtUvX\nUlq8tc8ltxO0iO3t9M+Yl4Haj+g1usy34vOdnTZBEZkE2nTXHSNOnTGIFvP6\nfE5u\r\n=8hYA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"dab519d15986fa1488e1c184d0a664c422787b7f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.0"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.0_1585721280842_0.5353306978657937","host":"s3://npm-registry-packages"}},"0.11.1-pre.1039":{"name":"piral-pwa","version":"0.11.1-pre.1039","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.1-pre.1039","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e05fb4944c361c8d8a4139f63ebb2e36087a73b9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.1-pre.1039.tgz","fileCount":25,"integrity":"sha512-GUoDGZNxsMW8XMtqsIgIKKz8o52LwzsdQfxo1duiWxospB+a1h7babIIs6Ok0EYNOYdzsR3NH3eK6/ywAAOBjA==","signatures":[{"sig":"MEQCIAKlVd9XskC0G4peCwvGzzi8/UET7FRMGn6YPdGCAJU9AiAbGdQHZgEKPWzC5nigqAmBH3Q81qq0FmYJDImGT0QSsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehFnaCRA9TVsSAnZWagAAVxwP/ijEGWR8y1y3sEv9Lhy2\nnHt90G8i5jAPUpgwPMTKbse4logaETU14ek+4r61GuxvzEQF5O9XU/louSry\nNITOsAJSHR5Y3mAg7mgKLnKpkDP5NQH5cT1iflg4xuooWPzYmuJTFaQ8gm7t\n1DHGAoNi+Nj7GCjHwoJeHFoFTHs3jOJ5PFqs1z/gYNcUQPL0VVWp1vtmhN7C\nIsBU92n5xyHWzO5fGJ5HlROc40eUsE/ubQV2sA512bdeQcDwI+PfTh798Qg3\nu+e7vx3oKaMMkF+bugAVRuEZzAgbJi5hhCEmgUO4n7f1H2vN+5UeRI//rG6r\nlTJOB4AD5+1iVJj9gzoXFr3+A6H8RgGkveoQ9Gf3XhNZmhT+F5tXyXkdItVd\nndoqsPGJmjXsr0SK9eGtVPNPzlcYSdDwNSWmz+bVfTQi4zevIWsfpbCJMjfd\nmvivjY+Rv/NZ8yhocXPT95ap+04fVU6dKMVT5lOtMFRmt6Jz4LSVYrPkKID1\nqTNLTn7u0Ihxd6ONZOgqeeritETbzc4XzNGTH/509DXhPvBGs1KdOm4SZ8bb\nxrqugmUEQtBBKiLgk8qYpv6FPBurYvCT/QhwaCO/XnStgtJ5LLzIc/ppgJ5t\n054cVgTkyiP/4SAu598b6/ex+qPTzsX137CUkIuSgQX+QCmiEHhGOFjDZNyr\nICcK\r\n=nd15\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9fa59279f63fdaf15eaa5d82627eff741588120f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.1-pre.1039"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.1-pre.1039_1585732057975_0.22528161278407333","host":"s3://npm-registry-packages"}},"0.11.1-pre.1050":{"name":"piral-pwa","version":"0.11.1-pre.1050","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.1-pre.1050","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4af7658fab822c590c2fe994ea53a2bc4fc23d92","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.1-pre.1050.tgz","fileCount":25,"integrity":"sha512-C3/sbE/zBNPiOmCqTEyY8j9j9Ewl9isdo7yqyVn2SsQPmht/uXJAFbnP+viGAhDG6/jhc5s1uQ4VsGAobw0GFQ==","signatures":[{"sig":"MEUCIQDNy5NxSwEy2ABNLvpTN8//5PvJcf/hojhBazKEftHGVwIgLQvijVWm2PPIG7qFCu/MBVWLEROG9v90kVVDKzNhpaA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeis73CRA9TVsSAnZWagAANWUP+wYd3Cbvz/L63ZtDCJZr\no4y0HimOUJOXnZPU+ZDIc6I2aXC4e0IPsCtWtD9Lp5UOJ3o+S+rvo/RNe+JS\nFYoJ9y7I1vs1sEFntqrCRwKTarA8Sm03QttvrtEMhpyaVs0xaNfNUGT3iUgX\nC1ddmzq9xuZFrJV6k/5NO5/CKFtGB9iTRvmGB+pi38geW+XftzXHYhxwZe0K\nRYiqVnYeIJIoffnJ0VhI68Yga2/gpe+RRJQa0l88EbBy6lBg7ZzXzb3n9ISr\n5iOo+ONtDDC3yN5LCCzIclq7tIqxwa7bpNBTBku4QZmuhV+crgrAv/hZGpxT\n8wxLvslwdjk8840oYXrl8xTQYe5Nkm2Gkb+x05e6kuKdP8gujVf0rXB+nYkc\nRcrU9Be0U3RSB2Z3A//PL5UE1Gj6p0/2YaQzM2MvE9IJibrTz5977SUQj6Eb\nptCeYzyL0wzsLGrbu3jM9S1Y0tmS2d8nJ320TOfJdFnFunZGQjKLbUCEz4LI\nW1Y5DDXIZhgtWZEx4ljGoYKfdpduk7DGi7WGzrqJe3GZ2ErAVCBMUa7BdIBs\novOBBin+1K4RRgLpv5tcsUgasTFVEARSEFIPp3Tq7zV7hGG0qmEVu9haoKAK\nS9luRFKgnZccPvCXv3YNIJnzE/RDXII2is2/T0wGlXn3CrdLWQCHzKlkwZVw\nIw+k\r\n=XIPt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7dfdde4ea9e8e9469ecbbba473b6a0d1f214e001","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.1-pre.1050"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.1-pre.1050_1586155255478_0.35802515291536774","host":"s3://npm-registry-packages"}},"0.11.1-pre.1053":{"name":"piral-pwa","version":"0.11.1-pre.1053","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.1-pre.1053","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"031ab681a9c61593d1eb092a08d1954d02aa36e4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.1-pre.1053.tgz","fileCount":25,"integrity":"sha512-KPKvGLYZwFqrwg06AS146pq22IfAC3PjOsb126u6c1KUeNoGu3/frm+Y+2xw86V8Ri3B+3EjIhGp6b0EXuIBOA==","signatures":[{"sig":"MEYCIQDqQVmT4SBGzKDR5jKDEJ4tCTv3fM3Zpa6FbATpzsKrnwIhALVx96+1nhnhczV/xf3eAWgSnkPpmzoAa6a0pugstwqv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejbftCRA9TVsSAnZWagAAfa8P/Rz7UUs3zVKvXZ3ES8EK\nJd+2vWfslVMGgeiNntDc0OhrFVFDXyafWLzsvH8m14D5iJ2fwSFXXuNxPSqj\nlFZY6JfJiGBGqCdsIHLBHjd13+jEGVz00ZdY3VJiThB/dOiVVJaQ0SGaFMxO\ny+TXlXhFIpVTC8UBH50Uatuv2m1LMbkgiADUMUv7AMt0K4ZXqQ2TUBPQz8fD\neCvj2pIMp4hJY1Izxy2axZ7JnWkkBiqJuNcksbzZO22MSNHMSE6lu8n6CBxa\nnvPb5grNVonufMwTeiTXtcklAjUWj9Ww0AbfE4ZyNAvSnqOLMHUeAlBMxP7e\nYxldyovo9A7q139jWvZSWKz6P6Lyz5NNV9pud5LIXpZN6skVV/7kjHUBp7fw\nEEQxLvL+EWtMxjL9HYvsA8rrnBHMSwu4Kj7ha4/ZywgfVlKJODD4jGznCkX3\n2rFwT6i5cEGHjgqnlGDb9ql6OYS4XUbhUlW44QlCNOItAQskJPSoNjd9wQxy\nD9GczvvPYwHvBTFB4lFjdPxBKL42EGGENO2/QUqjhrpPae9LHAmmKnifPhs1\n3urJ7xkAGQJmkjFmpKplQqo/Dpjdw5V12L2Z0Clj26Dv/7T+At5tSBSrreqA\nyQV7cznNNtiK1SumFrPvo6agf0NVcfNTU9VR8CbFiSnaYPCr2mun6ozuyEU6\nklBv\r\n=CtLJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"02c384db2162e9ecdf276492fce3c47457e2dc7c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.1-pre.1053"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.1-pre.1053_1586345965086_0.9550803207253775","host":"s3://npm-registry-packages"}},"0.11.1-pre.1055":{"name":"piral-pwa","version":"0.11.1-pre.1055","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.1-pre.1055","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8be75f8df19bc6a91ccce1300470dbd0ef88172d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.1-pre.1055.tgz","fileCount":25,"integrity":"sha512-cBDX8UW8eGPH5ocUUMxDSctfO8DtKJ4FawyxX8bntcv8FmKr77e69KtIp8GhpwgBnmqRAQsD6rMHJUVlPjfnEg==","signatures":[{"sig":"MEQCIDblgRNCI8x7qWogzES55HrDjAIDhcihmkGW+PjiO3G3AiAykuPVzA8EAko3WCszouxRMctIAQ++dPsTtcPX3YFjVg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejh4vCRA9TVsSAnZWagAAeA8P/1DNo+L2po04nD4wKfx9\nvtKogVyd/tVG5bbpIvcljkjdeZp8nWqWWnjnKBkG/x58+4JaSAwtd3FFU0Fz\nzTD7i4dD2i+oeuCQPt5M17mLbBURLP8vGeD4Bw0z7Fe2G/J9ihG8q2BKd9DJ\n93Tn5iOnUv/+gcTN+IyAq0rNDGoYxfbQd7ZnvKBxHi72ncQifubjZShN7FHd\neq+4AjWtpeBymkkrrr2FADRzSqUlQdYgJevouRXD/NWmNvXL33lkzuZADxwC\n7pY4tQaM+JuRrnvDn4/5Vu4Pkf3v9PmMj7cd0nnF/UBsicRnDe5nhYNBIubU\nnqiSdwbhMp2qVQGE7NvIF2W06liZ+aSsHK6OrJt+SG1npr80pAF5Can/eN5Q\nMPcnMoOn+ArDt28uN7vEHapaOCabj41AfVxeYdvIWR3pEZKoJk8hWZVW5jpQ\nYf763ppI0DVtsZO9I1rYGIY256bIOckUm38s4BfnCw3GliQHpGomTA0W0azg\nFzL+ukjnrhb7YsPFA4UK292aIGQAOwmKGgrgL4vfXGxByj4fhP61+TUz/C4Q\ny4Of94D8gqawaTtr8GLyCihMlUzrInCoBUVgorTNgnS8Nb/6lFlBpXTT6FxP\n7bWgXuXpcQhqQB+df2Mlsl1dyCYMeNhXBo6INr8YDq9hVZG/rkUSt2j2pusw\nNFsd\r\n=fnjx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8c3fadc6ce15f27a84c3370ee5a6f095ef48d9d5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.1-pre.1055"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.1-pre.1055_1586372143330_0.1545301107117949","host":"s3://npm-registry-packages"}},"0.11.1":{"name":"piral-pwa","version":"0.11.1","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b04c16736cdaea8b9f5bd4128b9532b9c6686565","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.1.tgz","fileCount":25,"integrity":"sha512-XJ9vXWmo6oZqF3BfvtsKRuH6EDXA8pUxPcSyynEL8+FaiBQ4jPhJHusk62C5VUu/EbZdhtd/w1Y3zl62j1r+qg==","signatures":[{"sig":"MEQCIAoReerM2SgpFhNR1H/vD1o3NcdjTimRkfYWzAUTPQZpAiB+JbgoEShQME7T3ExfrGt1xjKJY69m+pnRM36abXRo9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejjGNCRA9TVsSAnZWagAADugP/jJqjZRzYqiQ37Y9OwKg\nPHxPJ2B9dWGJnLYH0xbko9hkmabfEgs1aznc0jhAX+4X9vwvbIy7OJuwi8o+\nsMhApaJS5C4JwvMpJ18K11wbf5d2InggEHGd1Fx01YxCXIGdkYjB8r1iVQxZ\nJHgmIMRDTDLPcF+aiNBZWEifeBANh6HUPLgnRq2LPzCSaD846hh2IbnUQHIj\nFaOlSgtD2QXMAJpPwYxaJiJJKVt5hP0nvQHbGoYGpJsKr/PtW6EY+c7ybHex\nvT61Io/fI5Lm7N5K/Yvubai/rsgRDuTIvHU7Jwncfs6wNgWJgmfE+jKwqS9q\nmAjxVHis2cv8v734SlawcN/bmWyPW5pIkXergaR/aH/dXBH0mTaYIw6O0ikG\nIYE58HiU2w0MqAQ6SDsjPVtvc0hYOJyXh1aENOxNlfQodbu/d3Op+1gxgq1t\nzgVjxxt5LvXO2Kn7TC7SfwZCVyJ2EJeRA5xVQXzi2JIYC057ZEiDyxNFaZAM\n8Bc8YxHLqu5E4u2i8ylMeoRff5Jl3N7oxo62o9g2GujLdi4hsyXbx/KMY8b+\nGG6RFLUNc6BHxrOkBNgNB7la6jRS7mjGJ5HH3bFoOWjbCmt7A7XWj8cJY9BM\n5K0xOn+TqjEgyYH1k3eeG8PF8lSMFSvr0Zc09Mi8I8tcEOO1JECFZb3C0Yb8\nP+j8\r\n=zIpB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"8423e8188c56c532fa01cecc607ab1664018bb15","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.1"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.1_1586377100641_0.5611502958928836","host":"s3://npm-registry-packages"}},"0.11.2-pre.1081":{"name":"piral-pwa","version":"0.11.2-pre.1081","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.2-pre.1081","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1d5aeb39c55b732965ad53a7408b3b572697b8fd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.2-pre.1081.tgz","fileCount":25,"integrity":"sha512-S7dp6+tCH7Iq6Lccys1KzM+xhC8yE0gMSQ++NukmZLF17vQolYZpeD2lQgGugwvLokXY5vlsEPbf3co8QlUzvw==","signatures":[{"sig":"MEYCIQDvpDDYQienv+Er8h+bYBSO8WA//eoPCL8GfTGTloXL6AIhAOZ8DVDN56aLB6Muxpah0kY+H5Ysgt5jZymqGaN6B7t9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekkFSCRA9TVsSAnZWagAA5MUP/jgjBq3k6oX6oqNjN3g6\nFN4sRCCwRQLrOREKDvcDSVKC8zjQEFGXnVNokqZA8SHH9ia/nK5eIRiXb2G9\n29fcpDIuUdByvNy/MJJAi/e8rP0tfXP1ViTv712pUvUdcIQWayqhB7zqG/rc\nhoiz+xK2Hr/8t8VAqX/SY3pdYDQlmDwDawK2qUtSpucARvTHXVJXkD3c4GK3\nGSYXv0X0SaIQUCL1PGjErn083izmg78/prMz/yi6OTBzoJKhmXurUn9/UG2Q\naHkPUCCe+csHSmWfp4B2CTdRve2wQ+rLTNd1ubaq7e6gI2vQhwuKLZLcUfqZ\nwIx+MdN2POs9zfPauHM0UoCbmJ05UWgwbdbe9tTh4keAdCzhTioTk7Q/Gvap\nsJ8YXDbGjLHhaS4NmeP6DUIHSaWpz2QrCD592OfSO0pFtfh5El9xnZ+1X/MH\nobTItmt573zAA1s+X1wxug475WXmMwDdZSANitqHj0jXLkp3kJF600oP+Q39\ngGxUq4NQ/jXd63V+hK4rngy6TH0WiUxxggORMY7ZIkytycWUdaNIJku4NCHw\nHhyvnd5/vusf9l+3+wzOSaHYj2HDjxZZMAJ98fXnxWL/bl+iB4JV6FzCC9M0\nbjwSpQY1u1XqLWNWsRWk/3/GnT1ZTwD/uuOf5MFKsCEcsMttmDULzE01ybAf\nimzO\r\n=f6PC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"23e7fd9a8f9ee8abaee52fd6572601aa40949f73","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.2-pre.1081"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.2-pre.1081_1586643281598_0.5434053462419153","host":"s3://npm-registry-packages"}},"0.11.2-pre.1094":{"name":"piral-pwa","version":"0.11.2-pre.1094","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.2-pre.1094","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d79fdc6aad17cc7390faecc5bda27841b6c3b9d0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.2-pre.1094.tgz","fileCount":25,"integrity":"sha512-aFyfo75/oBESLEMbaN5hoDLGSAvz908U1HRt/heENOtjOaHchFfH6ZiVIBTT34XTagF6yHNbSQAZZpdAthdccw==","signatures":[{"sig":"MEUCIF65mYhBd730qeDZaJ6aHwqWWMnX9p+KUKPAdmWuFlAwAiEApuyu/k0Jep0LyHImtbKVRzDuNuz+3qMndSZ3kyD1a2U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemF5HCRA9TVsSAnZWagAA/bsP/3fPOu/nHq5yWYaDSHy0\n0UFfXeN09HpjWQzmxqLK4Y3KiHe8MykcZwhw7JGUWlzk1J7LkkRmXT/MQQCn\nKqPkKrf2rgVcYkuQaIjib7Zu3aHXuHNFpazyltg8Hb9XLptoSvlsjryJCijd\neMCXfI6v7zG8MZWSwP44mVsZxifydPM76SIxXWfOW6fY4mYn8EtHidi+WiCu\nH8dX99gkgxYJt0MBm6oZDTkUKBgN6/+Kg1xmBwjHB7r7GbsdRghwiBhRwiwy\nOkqpSIVvK5yCy6/meGvggc3IqeNGViE+M4qXU9IeuD1aeEgQrVgrz6gT8Ydp\nUppCh0BUmuyzDv8KNOWSdcPXL3fYOvwVMuLqsDxJsTwmCztZtH72qJEDOh5p\nw3XHvXX+EJe5n2JmnWozE86k0zWl1uG3GvZJi6bhyj77bG1Cg+uHaYMh+4pT\nv8xiwqE0w9Ib6iFI5Pj7IgIV7tTb//VPYiZsHXVZdhArmTF0z+kRdnD4P+xf\nYl7SNCc5darumAz7hueKuYizoaaKDOGig3snrgN2VrRHTTXPtdrvGWbNIe7t\nqPpo9OMm/8agNQnaY87Upo+2qf1ZiCN6MXZD6pMbBozJ1RshtZsbIu1H4o77\nGfXoqMmtdhEbTTRpQ3UgoWSfRCuNXJbawRVZzjZd/e5q61psLRWqz3ekWmQQ\nFA7B\r\n=e//H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0a1d1ab093ee653fb6ab59bf518c7c977a1eec0e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.2-pre.1094"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.2-pre.1094_1587043910519_0.18304017535353312","host":"s3://npm-registry-packages"}},"0.11.2-pre.1095":{"name":"piral-pwa","version":"0.11.2-pre.1095","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.2-pre.1095","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"970b7039ae6e536b9bd5705b043fa96ce95c3810","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.2-pre.1095.tgz","fileCount":25,"integrity":"sha512-In94pS/cCifUtgw9/8n2qLBMM0X1S/iTQJBoigQaGsbEfZ39D++ElivG2mb11Krp+9ww/Q872WRKG8jD4Ri6eA==","signatures":[{"sig":"MEYCIQD6R7OT2iYeuVP+W3sNAtdu8wGU4BkwiG59B459M9GzFAIhAMet/pXPKEpPQ+I21UCAQTvxNeseaX+ZIRuz1M8wiVWB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJem49uCRA9TVsSAnZWagAAn0wP/0gM3wlEXlWlhf0jt6jj\nc+JRlITyGqjlc/s1KRdIM/+oU1Xxp0TdMSCpqJsJNFNZl+veJiPbaCgiEJN7\nMk0pUmq/u7+45HYmgXbQRQQsEZcubij+xrU84w8oLGusNPZk8g6NxTkH9fFg\nXgDZAXI5g1dXLKkMrbs8q1MLwwSS9WmZ73Km4uu4le1AFI7eftrRxjF9MHbW\n/YnCy8K//M5W7o5ui0Bd0B8ihk9UPbcr6fB0Liki8MecR+b/Cu0RFLs6mXb6\nTidbck5npLJJhb2jrmabkUHfACm+XjClqiOSRs0p3IXZlnBWzVDsutKalXL2\nhbgsJWUF3jrsYuY4KiHxle0EhlERnQ1frnoFP62bh8xWSCI8dLUEzF+Kxvy6\nOwkLTNkyf68cyTm56Lm4ohMkh5QK9haCB5joOaCHOV5hSvxP8FpvE73T6wy7\n60z91fkCdtGtAN/n4fU/pFvPADQJvSYaaadU4Dh1GKqyMk/Ry6WfXcWdh7kg\nn6abl7rviC47puBTslDOmo2iFg96sdGYXS0Sdc6CHV4gCd1K3tzC5ADxh6jj\nJXrKD6TOKNqDuquifeg+//iTCKK46AeK0xFKkW5nsrA+x6I5gGMbjQ8Zu5hs\nccZ1Syi1XRwDSJ9pppOtmBnI7a4h5L75aqMqrXZ+rPt1L+DcHvexK6/np2Zj\n1Tsx\r\n=+tiD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4dce013bafc1d17b04fb01b04f5fc4785ee22b15","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.2-pre.1095"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.2-pre.1095_1587253102439_0.7045846353623406","host":"s3://npm-registry-packages"}},"0.11.2":{"name":"piral-pwa","version":"0.11.2","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8304297b8bedbf74db26a2cf1ffefdae16fec1fd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.2.tgz","fileCount":25,"integrity":"sha512-0rGUUl6ferimDvRxcvqTcKy0pDiMWttiOE3A6gE2/AymqChGByAKtcqVSK7fPOYV4PO6bWkOg/1Ih/agbhST6g==","signatures":[{"sig":"MEUCICLXLYCgjavxAue+mzi7U385a20axIaAty/ArWAiwB/eAiEAuWlLJpiqxAyRpIytX+izBgFK5GbKq4GTvDPtDbHvhPg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenAgOCRA9TVsSAnZWagAAV/8QAIc/Vw286f1kc6ghP7S6\ngjAgF9sIihNxJ5vw8rTetCz2/VWyb0Qtt324MUUiu/v89jYT9Dep9yl9utk4\nZTTNueF6L03LooPWkrIEzVrJZ5rFeN0TtL9Z7AMwiiq6Swpyb3Mcl/kEchgn\np58A4DbhBUuI26N3sKrQG0a3JR+LoBMZbGZU9EO++df+Fh2XPl3EcXKb4ri8\ncvwyU5XVu3gxGYVJSOllhPfwPmXfRKEN5ID8vWUbOZKHKSGhJuWQ41Wr6Qy6\n6rMXPLXxB17oVyJ9tEUiApThM3ff+pitUUBKBUQUNToRt8nGNg2SbmmaE+Kc\nLsKAHOwY+oxmWRYkieGMuR6gfzscDGRb0RzB9TXMzEaTCK1cxtD70Z+N3RUV\nwmYnT8+I6whVhKRZnzVpByU/TugvCd8MHL/SX5g/JdGkeuWbMOGImIwKp8Ut\n3mdLGXoYoJDC+xy0E7mh569pdmhfd5gcqtw8+2OHBfW0wu4wNb/zJ0REFJW2\njS3tE0UQW6pCTLY0SSBDw2In0T1cS+Q5nApSlB1ScJ5bGeZogY7EP22RpvOi\nunDOy4oBPbCuE3ZuIhouRpCadCZ3f7PSZlQRqT9ED2XOe3K1t9tyV6sKta0X\nzSTggVgpnxH1JO7vwi/nvjR/aHa5wWWIhJSWLwXU7vTh567NbJ+TGAGGhSkb\nrNk4\r\n=OQcm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"4b61732a1458cce64ca91393e8580dcf3742c0c6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.2"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.2_1587283981634_0.5433362637068708","host":"s3://npm-registry-packages"}},"0.11.3-pre.1099":{"name":"piral-pwa","version":"0.11.3-pre.1099","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.3-pre.1099","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"06d39a84e3527791a64b37825a9507c163468ac8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.3-pre.1099.tgz","fileCount":25,"integrity":"sha512-XGtg25Foo+vJnUkxOZFM0SDCj9EUNUGmK28LEND0xvGRm+s0jhzhiBiYz0RcWm9BDZ5Y90hEn6cMc4IqMNpX7Q==","signatures":[{"sig":"MEUCIQCatd5HAg9fLH/jwcs3qCMxR5AxJKnRCUW84P4HNQNwngIgGjEJuoTfbZ5sLPZRnv3YNUd0LKkd/6HNmu5PtrJU3CQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenimjCRA9TVsSAnZWagAAgX0P/Rje1Km5PgRdH3iLYJrW\nVSagMRRAuZeowtNySpZW5umtb1wrHMWjKy1+wFuOeL13Ul+g8XD+sOcd7Wze\nar/d1FG/jD6Scojiig5JS+gGfauy7sAEOdv+fMrDRep5lyP4fjhhN+Y1zLv1\nKhQtYmzC66uUzFGiElrvSqJnQhss8VuYtbaHJJ1Y51dwq/V1Dz3sik741jJE\nWN3tWVrM+GBacXadEAY/00uz868/ZIQf6JxhmGngqbcKlwXxdXH+D9drQsGV\n5IRdlizlH2C7ApFShhfmkQ0EK3Gdb68RNr862bVgUV1u1HHOnIER8DIxq9cc\ns5Tw7dngwpQVYGEDDg/xPNgm0TQkLedKya784HsWr/qkTGgV9GuSeDSyIZEj\nPJUvTf0sdLKUFlCaLTzB0dkMmHNfddhqpZRNGsZ0EhgGXBxWbZ28IJslmzxO\nPHSaq903PUzkSLZRxonq6u3hRLcd6KKFwG+v1AAuIlpLtqaoOITyBMekq/xr\npKdGnsSoVJ7hXDC3N3roWO78Mx3Th13jzuF2i77atVtBWG9EQnxWVwLICy1C\nf7AlalxLVI/GFkOlzAptt12QHvMr7h9Q8YRoO1Yt5H1sbw+a3jfojaRTUZwY\nU2T2o6tDQA+EE/sw8bzh/kdjxCijseXaEdzzzVbZ/r0+3LJ+bgv0UmodTTC5\nx2h1\r\n=XyNH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"54104122704bcb62118f7c7dedb0bcd4ad0e3798","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.3-pre.1099"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.3-pre.1099_1587423650931_0.03827712885917123","host":"s3://npm-registry-packages"}},"0.11.3-pre.1117":{"name":"piral-pwa","version":"0.11.3-pre.1117","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.3-pre.1117","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"030ca345feec90b353abb3f54b941912ad529c5e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.3-pre.1117.tgz","fileCount":25,"integrity":"sha512-WwTzVTvbQUzkMb/AqE22dthu1SKpYidcyStubHzZ0ChtI4JndfnMRVQWAQoj+epbtYRQiZg0RiXjFJ7nETqvqQ==","signatures":[{"sig":"MEUCIQCRrw9lPprIeY+i4+84RKBGY67LxyKi6KlHyjsLhKUVnAIgTK1IyfeVc3PLoC5nNUxOWwJ9ykLwNDiCZLDNEbm49Ww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoBWhCRA9TVsSAnZWagAABLEP/2pvm9cExul2eDikhSTV\nFz3h9OKKGOr3zp5qcbkI5JwbjttUritG+CXAUSArnAYTkqBlqOhmdgxWWsij\n1ofgzu7tK+8cfYc3QMrlM3UqaYxZeSXGz1UVEmKRlYPz10Q3/B2LQVHa1tfZ\ncGyCdHloePs9W2ThJ0/Jy9ahUooIQf/0nCSHXRlzZ1OaCv5VfzqPThD//OMa\nk8LqJuawPiPxUiL3zLvVhCsGcBQyb+SLC47d3FPbGJFvqioKhyDref0JpjMR\ng4JMGQYkZffSEbq1UZJly94eN2700dNt2Q2QwFPIhsDNNZ+mf2uTfBj0wVx6\nAgpEWQbVrXemxdWRj+wgCZ+3EPZUJFaTdkmSQg6tNYFEFGCCQpHAwHxnhh21\narjrUIQRk/0qvnS8H5FHoUWeAG65/0awiWQFuxXm+Dg50CsAhAJ8+NoZmzTQ\nUPIbDU7TF2svJiLu1RUsba1pnChuH9Pm5QblOWfwaTM9RuHfVPPa//VPm3lQ\nnwec6XjgeuvggEFpKN8RfEPbLXiodQ26IkBQ7BpQ15BkE45P5nzqk82lO+NX\n33JTdRhBkatiq2hkSwT9nvbuPnj0NGCIXHEN8vNPnqQO0HRFKGVMLMH4GuzJ\n/Dz+OXSwk94ytQOQFdPti5LZ2dgv7BpW0C1v7mA3Zq7Lb7k8DxeUBxKdZLm0\nbw3L\r\n=efie\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b5a72285ad07aaa9716bd00a3f09cdf50ac7ee4e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.3-pre.1117"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.3-pre.1117_1587549600776_0.37753381109128337","host":"s3://npm-registry-packages"}},"0.11.3-pre.1120":{"name":"piral-pwa","version":"0.11.3-pre.1120","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.3-pre.1120","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"22f9de8fa0e1d5ea13c61eccad47b119d9a24cc9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.3-pre.1120.tgz","fileCount":25,"integrity":"sha512-+aMmAhRE6g0waPWjzfyaJl8BhqEJ3o5KG7NXk12vbApLS6nCFLUMOWpxz7ytZryo0bdvyJZa+uEn5EpBMU9Ong==","signatures":[{"sig":"MEUCIQDThiSkGMf5X3/Hj3aBTeFlnQy1AO5XO1ORuniJnpfUbgIgJcJMR09Lsz8+cg39coJT6xwftIN+fEC3dB9Kx6/PINc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoiZuCRA9TVsSAnZWagAApksP/3u4A8wU2BEGdMRuxtkP\nTDMnEuVB8VTVm+y6fTSxqVnhCff6//vFsCrxW9UyoHcTvdC8e8ygYhQQVytf\nmOoIA+nYflrl4gl0t8pvuRK566R+XuZHkX+LkCgS8mhOj5t7BDJd9mJQELg2\nEKaf01Jb+C/MqGaL7veegJB51+xk92E4ylUfSbncEVgf1DL6pLPe3dTMYRm8\niVG8If1h8RHReqrJELdvsA2YyLMiUZzCv41GqYVLnqg4subMjKFeji3lU0OY\n3G4osdzs6DeRpfnmljjwRfy6w/lQPHuUSt1vLrKjeSqhYDSkIKWHhWHoiGDR\nR3kimJKC0thfGeyIjaOC+ubNrSxN3fzsLUaJaIB4qVJvKoJlKLo+EklOjFDx\nISIbLiFqn8jTd0dPObmDWd8kP63pd1a3GhgXXWR2dCKYXDIzaRFyhZJKPqSo\naWKkhBXZ8WotJ3LXjVgu2rZUi0TDTD/pI8dteM0cGQMwEfsVDwamUpb8rGqf\nV8Eg1ukZElQQ/SuwCfOJ1lhWI4SaSbRiAK/p5/74rpRjklypGtXL0hUikZ48\naDa6K4H2GYa+twaKQlpWn2IIrO45d0aBq4T3NaLS41JY8jR8jAxTiEp/kSuW\neUwQRfp0qzuBe2Br3HrLDADgvbqRhhkcIViGt/fonPQnyNFrjnU6llPbdTKX\nAx6c\r\n=7+tD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"372cfcab109f1329fc446082d0b0f48e2d00f6eb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.3-pre.1120"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.3-pre.1120_1587684974509_0.516882769333967","host":"s3://npm-registry-packages"}},"0.11.3":{"name":"piral-pwa","version":"0.11.3","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3b1af10361fa6b1e6588664388aef35a29ddb2a5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.3.tgz","fileCount":25,"integrity":"sha512-W47RdaveZrcdmEbh5y3dlmuWhpmxY/hmt0h9yYOdi29K1VQiJtyAPj9ZNp2ctNc1j3BDDXWJ6SsfMAMnS2Jd2A==","signatures":[{"sig":"MEQCIFCHJ0dLyOSlY3R+kEnCk1nR2K3R9R9aYELyTiy45vjCAiANIiQESKeWV1wo3QVY+/W70UZvUpp+LMbtOBp+0ijKNQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoqQ5CRA9TVsSAnZWagAAvioP/28eqiVeq/glLyQ9QpNo\nGWaY7fz6ulVzy1reKcJNQ9fq3J5qeGTJ/oxX8k7gGyY+EuhPe9m5xwVBhHKv\nzYBwwITSRyxTzrcKoql5ftCsrVVY1FoHO/L/gRtw5m9eYfXoL2zlAGq0Eu2/\n5U5VTHiuKkEOB+y2q3ZwG4L24TawoglZ61LjRdhXlyrP0zdDkBkmLUkT2kp7\nq431Ao7qSZiGg+pWuRIjlez4wKPzLnY4ALDycow4BOsM5ktOIYEc77uesnhP\nbuNs4I+6vlqS+fn8vHM+Z4PJuT3scjqKTX+Xt3PzT1Ir3ViZg8bPwv/ea8v0\nPZHSg3GYz19/CUo8AaAJY90HjMJwjKp9YPJOI0xyYobAZm47CkLlBSDedVye\n8t9Zf77ioV5YhCqQb7tTFYQ/yya+6unqnmnzlsybPyFYTInhopxuozyzuor8\nZ9DToON8Tn5wBiy+poEkioCbF2Zd+2RbgCaSrOw+d7/SmrPjEu13qkKa/qWF\n0Y/jGNwrQaUyubsQNjDFjxo1FhA+42OudYpTLfO6oDyncpMlZ9SP6+3aAtoO\nNHgTUv0BSgovU6h/MLg88h3YgAxui0yZUCp7Bhe3UUFK/pXj5x+ihh4U/SCR\nFYzC8NkTZp56wd8fL+d6Jgbe0h3p+j905/dIEu9wqjpkCTnV5hhXXVET6v1v\nzJgJ\r\n=lqhB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"b41a33758bc4e30f57183b3e6033167b2820d3b7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.3"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.3_1587717177563_0.5977431171975416","host":"s3://npm-registry-packages"}},"0.11.4-pre.1124":{"name":"piral-pwa","version":"0.11.4-pre.1124","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1124","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"928d2376c1f5f2d14c79ec80f1474a2504b5210f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1124.tgz","fileCount":25,"integrity":"sha512-fSasdGvrsJAFQ7SkkNlKgMXMvX3WAY97zKsUI3N2C4uEw1BchIKG0jQm+zooZWd4vsEjb17PEv0KnS4SQu29ag==","signatures":[{"sig":"MEUCIQCcMgAG0xxqArdD4v/XJMSumnIHP6qvo7X4gl6raE//4AIgYjt0tlj8JEJSoNfZmNqjxdv7+pRxYZ3BMSkfau41d/Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo2i3CRA9TVsSAnZWagAAS7EQAIEc8yxqltHKSX7yvdPJ\n711IcUHKrpNmYWi+won+HY4CEngS3ph2EhHeKOTuDnPdiFHgSUjSi90Npm+d\n0BNDaN9zYp0489JXeb46lH1tbo0k/9ciTzzuIMX9rx1qrCX3WeBWN9FFt4FV\nh0XMxPvDUYgX7ZamZ3h1WvcrWGS021TP6PD9vCXsbvkBVt1LiitwV+iCppqO\nkBGsIn74P0J6tS2g+cQBUNZb5qEa+/SK5dpqLqVRnA8T6ROwWm9tuF1qh/yT\n78IOJ7lWOg9j+NKU888wN6dq6Fz6ESjAx1B9vDnGuyXbj5kouFCuUGCJIJWD\nkSOCa6d2f1RLwGyTCa3tMM95fnMbkV3h9nUn3ODoLfDM4J2BQxS71n93iS1b\n3NXTSZR3keB9R0D832jkq2C29fDZ8NPoJEo06RoAAdRrR8PwDjW1k16bfHEW\niMn1R9g4dfLK7UWLZ28Pk7BKxRAWgusN0qQtqS3jIJmJN1Dhrx0x1Cu0i9KW\n1ezz2hdfESs8SxmqN86/dARUVcbRJMgJYx5jOm6MQO8dzuGRDK0vJl0B3D/P\nrYkpRqn+kqDck+5xV7ptGyXnErraZY1NWUBMVpaXaFE4r53w7LwMtNIGjvLT\ng2PypHag/HXYMnwW98PWdqA76wjh56vc+NdNWEYiPdZ8KtZEXJUeEGXW4x+q\nRDpJ\r\n=Sw61\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3015549938d3a7d3efbb8bb79af928e8a103fc05","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1124"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1124_1587767479541_0.09576745171321233","host":"s3://npm-registry-packages"}},"0.11.4-pre.1127":{"name":"piral-pwa","version":"0.11.4-pre.1127","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1127","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9279bbc9dc0241a4339168e9cb8d208ad6eef347","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1127.tgz","fileCount":25,"integrity":"sha512-XQURUVFCl2FlzzFXYCVebuzLcPqEEQOJtmxWK5wmVLcMmK2ipq9UjqKflR07lKcMw6weKe/YQEbelTTwqnalDw==","signatures":[{"sig":"MEQCIDur6u7/JCAxawQfH92HBgrsa5urmV9jR4o3lYmx9cDdAiB1HpDiOgavnvFu//ECYKr4FZtBEbzxg+jhRVTQHHNO5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqQaqCRA9TVsSAnZWagAAo1YP+QB78DOSTnuLQCp0LRAb\nCQHooLr5OHJSFm7JwpXTAui5UlbAQGLYD5GBvYbxoesP1+1vO/ZDSxMf5cOy\nC4x+eE9oIMYoU4KZtUNFtdxyItWZlxzgB4C0nQKpTLFc2084Br779rnwMjTz\nehuGRmr5Otk/O9QubcoIwg0aiXxAYhkuXW3DMQjUtEUJ+qxEVCqJmuRJEUkE\nZT1L7UqVgHnW98W3uBirVgylTXRAOe6e17ZFNu0r5JqcYr5i8R/E9IXLvFk6\nliwlmK+rWgUDfhXQJginieKVzSvq3Sk2q7x9KxFw2IvQP0kJgAg57gPgRGRH\nvvRyIeffC+/T/DqngfdlIu9lQEgD90ax83aTyqJLtANZJ/J1R/mbwkTaJPt3\nQMdAaXu7/Y+/A2utQYNtzk3PhMTuFhQo9h8H0T24uH+Ik/DoVnsEwV4WJjht\nf38JZx4U0rjOB2DE8ZIozmh2RRMV6rGYSAD9Zn7GCau8dzeN609gzraqs9Wg\neJVWZV2Z44bHsxvOxJLe/Tk0jZbVfH8iMsjJao2/4B7hYXugUs8L3yq+F7js\ndH8DZTSteAkd1qXg9TMi2HPh7r+xCeh8QB2qhfXH4M3A0OGxLJZmS2MCDToY\naDLmMAePAaVYNBUsNfsjPfiT4ZJrS5rxOLL2DiZTHIPSYbavX8LlHsFuPv+a\nJUBO\r\n=PpKQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7691dca9a0cb411bc472ffdabb09f3847cc8f9d4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1127"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1127_1588135593790_0.6214199992479528","host":"s3://npm-registry-packages"}},"0.11.4-pre.1128":{"name":"piral-pwa","version":"0.11.4-pre.1128","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1128","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1f2c509d94ca2c506794aeb7eb5c7e1f927fa56f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1128.tgz","fileCount":25,"integrity":"sha512-LJhe/RvJaFknWIbgSqvxSmy+QznJ0QjPS0kmIeHUm+GlKWCWFCrWRN0n5AlyA+tFpvOkaoBgjPFMcMyV49UXTQ==","signatures":[{"sig":"MEQCIFG5ZR766LZJge/BfvfzHZqF3DU8+eMU42pY1XK7pOcUAiB2LaYXvF4IJRNyBVV2bgPatUQVCG80xLRSR2P4nlBeBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqXTwCRA9TVsSAnZWagAAI9oP/RWqw2YJP9RmQFTCYi57\nz6GUksdNgNU2dJ3LC3jNcqd6E4GTOhOHVxMCTvkDgXfxBKmHFHoqaWaK0VqF\nbsawXR0ZsnbokYPlAic+pIpYGwfHuxksGVa98USV1unkU9j8NFXf9V6FyQUB\n8kcNuGNRtdWhyRzN3xwvGZKPjTHDjKuNhI73NLAbhljwjyOsPgi2d7DncDOm\nK84Yw4Fy5H/h6TJMNKBQtQhOp4rlx4hj4SdL4J60c/kCZ3FM4gCXWX0w7Ryq\nvWyHbsprYVQvBNprjh+35TPeJUZp8T6kLA8a5NA1Sa05Py3i3G3rP+9vRFO/\n/E7/VwIrbICG+PQoamQb+o1wlCGFx/NCBClblKWozyCYYZT2NalgiHGGGCeY\nhvoEqgg3Dv2NSVuMCalZcHj60Wbr00kdTf8xAT9Xk07GW9+azsraFBw32xX3\nUHrtYyS1/uhxRDOexzG9b1y6Id9LEiFvoOPIH6HQpI5dGj7AWnPVrrd0Oeo9\nmd6P1MzkXMP7lLqLegnnn9NnCWQV6RzF9w8Rl+nwGjPGd2moGp7oG0hXKYFJ\nTegMrrfvF9yiG/rHUZ0+JNJt2PUfi0M1kLeBlsdN6o5oW2997rkZAOutdcT9\nSWVdIULVlOnuzICMuytPG8zGrJy2VONRoxSc/Il5zGhZOd4s5GD+wHswdfhZ\nhpzT\r\n=o8L7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b704197e9f35e84d59a82b089f4f1839044f2c18","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1128"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1128_1588163823771_0.3999573477952736","host":"s3://npm-registry-packages"}},"0.11.4-pre.1130":{"name":"piral-pwa","version":"0.11.4-pre.1130","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1130","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8d9208adfb6f4d344e094bb4ae0f8fa091cc6130","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1130.tgz","fileCount":25,"integrity":"sha512-J0nWwXonfndMsx5IO3TotO2EeCmN84zFbdjCbv+1PRL4H8zVq2kkubxZ+/lXOzXmadHKEzoC9kfrTvRsG19V8g==","signatures":[{"sig":"MEYCIQCz/ddWrLYR3Rj0ZQg/CuATHyoFljxAzq1KGhfIJAKSOgIhANgbz0H05xe3wVNoqZCvRkosN8q5IxpAh7jBf+pb8vMP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqtI5CRA9TVsSAnZWagAAXQkP/jLQ3HI9HcldwPphrDa9\nGBTzlBZaT+IAzX70kOsDzwQgBZbGiuVb6cfAYOMrybaNrAa+ADvQOxByirV0\ng/sQ7tVpkm5nR+Qu/1aN4r+IaTIkQr4Yb2DW0YWCHv3tswXRhoacOEPOyCUI\nD4ffVazTgDRScGy6VPJcCAXB4ndLdckj45w2Zc0olIm7dv8wjGEMC+uuXJms\njYGhxiKLm2ZA4uyPf/byEaDrxx31eLx10oXaponpqEhVoWIjh4fcZPCLDqT4\nT2xn8NbBQrnzwC6afQOy1byacuItfpBBafwLME8eVyQX4lhsWgKn/IOEq0LF\n0U0wV9aRxNycHc5HHPVBWpMqBTpXAlsYeJHjTles5nhzKZvwDs3xmHSa5yWc\nz/Lqdg+zVJ5ctFrlnb3ORqI5e/F9VKCEkAdFpNSiIpY2DYy2Ekrp7CUFNdgx\n9n7CLuH3eo8Vyx16CX2bXh8xFrhuMq+rdOYZJHcIUvelxl89tunneENiFEtj\nYa98jcMiLp15YD3eRJVpSzQlT9d6NeOYNKg16uPfDCXrG7SMCS2pxb1UO+A4\nfuQ0oZKZtUk7Bm1caCTx+SaBAxTtKXS+w+/KBctoTZtmQchX5A75UbpblQBY\nkr36eoTTM+Yq2e4STNRth/oBrdPyjJ1haSTBDi+cTxOEQDl3Tm6Rjuy35izM\nK93Y\r\n=knfj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f827b542687062d5f69ac0d035b3c0e1d48f83c3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1130"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1130_1588253241301_0.4159741110569457","host":"s3://npm-registry-packages"}},"0.11.4-pre.1131":{"name":"piral-pwa","version":"0.11.4-pre.1131","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1131","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"69c63f5098ccf712aa61799bd2a1dc6ea739c010","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1131.tgz","fileCount":25,"integrity":"sha512-KF+MFwhla25ukuOTPCArIpQSFzeZ8bHwwV5thFjPs2LuQ4JMZNhoeSUkwhQiZ2t/vA0XwzOm79V5XGcrOaLYQg==","signatures":[{"sig":"MEUCIQDvS29cOzKmrgm2rPekOf/LNTvx5A7IxyhZ+y+oE0/GDwIgJHfMzjBxG5XmSy1gK/oepwWWVuIsqroETqM8DKGpPmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqt8ECRA9TVsSAnZWagAAncUP/09GVGPFocyq+UEwnxxJ\ngPHAlMBwuZ7oXHAYISApyUH/rc4ZMT+XJZtUQvOChev+/47JnVXHH3SJ+dgA\nRJzYsZj5m7P17QC5+FYH8SUcfnvJb3wHh6ntOqniUjcL7fy4w9Z/n3pYbx/K\nju4zPWdAsZ2itY4K4nbJfPhPhfTuxOJJ+/RS3IpIcFXSfZlctLEnGwxsaFvM\nKOtZMGDtZgrUBMA30mxcoh+1b0RTaytEBBHSOkA8UNhbXRIgm5Gk9gG+WN9G\nhIke+8FEcycTybp0LwuJfhFGTTtJ9ndrtpfvydr/tLdjleY0ky//zYRbgyxO\nJyMYTddi/8v1HrB02Pa26CH71D2m9fEKhfd01IuTEgRzCbtUKdR+z2dkZFm6\neN6VG744YzahGNTcNdLFqvycZUSeEhPmvJgiJ+V7GXirtGodVcuRTNmHv6Hg\nDVqpFvhxc9qVEaDVDeYPe3CRfIvJujFMpUidhF6s/nHqTXWKHR/U/fDQeuh7\nV80biO+fC+oh68K8oPekZaNx9mRO0LQIietJy1256z2oILTa3OdPQDt+JEcM\no2sKcpIV0jyafv5hK2hYlj73/ZrekEdOfof02xMXFpHZvKememGCRV415TyK\nVa5kNaMC2SDfkBB8iP4nHHjXdhFNgVUfjE4pHYMQwOt7kO6jbAMVEoCuXDvv\nrFi3\r\n=FOKY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"dc3c156f8fcf7aeb3be43787bffce84aacd6a3a4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1131"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1131_1588256516195_0.46575013509898033","host":"s3://npm-registry-packages"}},"0.11.4-pre.1133":{"name":"piral-pwa","version":"0.11.4-pre.1133","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1133","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"125671932e126c2c73b7d9330e683e2cd8a06345","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1133.tgz","fileCount":25,"integrity":"sha512-vOIy7pf43Xd4dHXRYzj+N5Aw9j4ij2iWd9A2ZNg7V9pOsdgJm/jmgcFzBhx6GeCrDf+ciglHDso2qgJXeG02Cg==","signatures":[{"sig":"MEYCIQC+OFDObeiv7nUdiIsZD28z4eGa2MgzYz+fS5Es1htDzwIhAMpyLFho1YX5qHGmo3t5Fbzm8WvSD4tFx5WJ3uSR6srJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJere2UCRA9TVsSAnZWagAAnDgQAJ+9ilxkgsVG+49q9v7g\nz6C2TyOBB6gPI3uDyXVUAkANHigEEKLA/xh+ya3RSouCbkQv0jXwFk1iaaUc\ngi/a/oPu2bbmEDgeBtGLKqotplpYMaMxG87lmEyzwjzl6grSTk7QI3wc6327\nsF/lOMrP7uc42h4kzAaEdth3abSUFqpec8Nb35O3FHIHAV+2TbodIfMHA904\nJVBVb69h1u4WTAVpRuagAPR8qz4zGe5PqHVey59OoAmkmE7O/eMahCGNYkeb\nJBmaKfds8eirtO46hqx5NlNGKxAHDZn74D52oY4UtovDDSpfPoNiFIHlK30o\n6new7X7jBKpMTHzsnVbsp8PlnVHhnn4kbJmB8u2+1wqMVT4dpp7ryUXnaJPI\nrPV6ec8MuIUYOJRzNFNlpgRN1dZtGLyt1wzB6YB4hyf4aoDpNJmJbM72Ua7G\nEXM6gdMgzSnhXg7khULhEPYkECC2CJV9x3k4D0EOv+XjPdVk5UfWUm+sfUcb\nz0NDYY4wm3Vh5UoF/CssQeT+mzZ6RU5WEAgojd9kWZghCUv/iI3d/emV1/S+\nbNylTVV5QLqp7zLNf6gg5Uz0FpjJJKIz/HvRwpxtR+HdDGC7IM0V8HHwnuKN\nbdd3llwI2+5znPAruqPcH+UbpSfF0Y3VB3WAkSrSr6rB2selRDkXPtYIhcl3\nqe/t\r\n=bB63\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"355d3fc1899b9d3562e202f679095eef53023026","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1133"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1133_1588456851839_0.6180725083252991","host":"s3://npm-registry-packages"}},"0.11.4-pre.1134":{"name":"piral-pwa","version":"0.11.4-pre.1134","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1134","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4aa83a66b8715533687c1c7529c233aab2e2e673","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1134.tgz","fileCount":25,"integrity":"sha512-6aFoFwS4hree2f+1k88w5b2ujgJZfPP1erW/oWGIcww4pxXeBuJ1W/SS/EM4MDeQ3e4Wkyqt21gDVdEVnID4+g==","signatures":[{"sig":"MEQCIATyLrt8/yz6GltOwJDq3LV7Q5IE7AYGCATkfmhJlbCNAiBkrV2mE65loE1eBDE0WCpXn6xw/Uj6oIC4SoWcAd2HuQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesJFsCRA9TVsSAnZWagAAlrAP/RHcCBT0nec+K33PYoU0\nd8NAza3L9lExWat8kqeamiMCIrRuSTo/GgLNFWy9kXGuv5DSlJJLEYlKfCWE\nWuydz62nHExJBCXfG5fftKHGnI9AEzUvFYkyKL8VuB7yl0o+mCsocFhdLb/X\nvjGBrXKS9ZT6bWPTH9xzYE10wtAvvpqsSkdeJZGcOlgDJEoqR09WLpMOgiSb\nQZZkdfApMOm6/v7YI04J4eiARgDniB8j2tYrvPX5Zi3UJwIxzzG22Faeuwky\ngh/V4+Ru1yYNJB7JxnBQYxmgkfwkcUITHLnqxUPVwMsfK5XxEDc4lqwR+6SD\nVggMZHqed7pd6/4kZ2Vz2oPAiLECLkT+IaUJTkSXhv5sAFmlbmM4kZE6b3zU\nViPZeiE+N1uooIkuH+3komMFxEevWJ/9pc7wih8EyMnwJId5vfozrDykMFJ/\naJXbVKDMYivc1o2+eQFe2/+Bhkl0F5aq4ovQ+OoE17iHfs2bTAT4BOzP1o6e\n4YGrEWxs3U/wHSaUvtc/0Jpv7dD723ChjtpaqLXMheMm1k+ntw1Q6ggoXEVa\ngqGI8IL/46146SLd4THTRWjqP4m1xmMhRv52o3kvjKTOpPCBYumsMlWXzLIY\nBOQUr4quOjiFfA0gzA86uyG93iBQHfE8usCV253hB2Y6d63e2SyG1dlK4exZ\nNML9\r\n=EIlA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d9908d8b3e18c432243ecd832599c5a34602fff5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1134"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1134_1588629868332_0.9233101238266095","host":"s3://npm-registry-packages"}},"0.11.4-pre.1138":{"name":"piral-pwa","version":"0.11.4-pre.1138","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1138","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b45e7a7835e416a4bb920feb4b5f1ff558c90880","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1138.tgz","fileCount":25,"integrity":"sha512-FNmlBu0/Rp4eS7jW/hFJ0yIZoxf1IlqQeIgOvimvEcngLCV0696ar4FzGgbhEkAgh+fZpT1d0/7MOQkYcgZKIg==","signatures":[{"sig":"MEQCICpMpYCwShKvNTT3keB9iyGZSGn962X7W89cQhpfeWVKAiBD5E7xKiXvaz6Lk7M1WQaqodwJlbgQoxSv37IjKQFZSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesY+GCRA9TVsSAnZWagAAkHAP/i078xfo6pinCZMiPmdS\nLBanoIqmwmO0Hoa6zEKoWyT3A8NbKbGnkc5TfbCMF+quZCD3RszWLkzog2CV\n9gOk1e/eG9n/MewbdjmbGb49EntAaA73i9b0esVWyIXenkh6lylEK6XhfmME\n6f0a2t4SuDVDc7Wl3kGde0H6QyvFuebTeiTJI6dgCo3G1dL/dIrDuqvqJS8V\n4ZQglwWyNxFsZC8R2T5GtqoYvMkX4YPf5C8YCf6nxutv9sVTz3GkheB6CW/E\neKnaMKvnpExxMppPtb6QF9q+5hDr71YJGz1mzR3sWcE2zDDFEMJQGSzfnOi5\nwxDuFQwTQ0Ts8PdDA0RkSi2Suhj7g5nkPLu5+ptDc3Ff0UJI5xr96KHqhnDn\n/9mNfWTHufhlsWgitMQYS6DD/CrLteSVu2L0FhFk7lEHi6NiqzrH+AEGbLTH\nrHcNqEFn2aq9krMpSkAdRZ8VCnhUYWYN5V3NCdHLw5Clwb1UaNvhnuAMdDFc\ngqwKwOBhYneogODLPxeCDV98b2Dc9H6di7d+kGk03XU9Bg4Fin1oEcZJxI0E\nElHdMP2Dsy0isNKO8ewYw18mfQN6BYV39x8jJh5qwyA1ngiITdSz40Fqfbn4\n7XH6zytyNt8AVB+iQjmQuAXg6NevTGpy2AazQOoEsi7hqk9mu8bqLt5iteev\nYlQ/\r\n=GVKP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5f1285eb84470211707ce8589692d921fa3b95ed","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1138"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1138_1588694918581_0.7597862412396701","host":"s3://npm-registry-packages"}},"0.11.4-pre.1139":{"name":"piral-pwa","version":"0.11.4-pre.1139","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1139","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e1ca66d6309e34476b1b3e31910bd58f4706a071","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1139.tgz","fileCount":25,"integrity":"sha512-WU+aaPp2cA2z7iMh0UZVm6uYy+vc44y17cU75MDh3tOxmpGjXFtNSJLeKig7MwwbzqR1Sb15j3f6DcqEF3T7hQ==","signatures":[{"sig":"MEQCIF+zRswKr6R3/TRlNUtg7BS8DHZFdJmshbPRJrZe5u/yAiArrDdf3ZIJ2DsO5kQO4GKI+whdT44JIGMGLhB7fjHZNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesaBSCRA9TVsSAnZWagAAtYIP/i8Sl+wFomQr3kdogrnW\nO8Hr+v3gX5rf/AVZox8fQrRD8vY0LocRQmg9yd7egJkN7yJh8B2SBeH2IL62\nF6R8Z/fV/gCavVmfPIdBlayMS73yFsLU86g4/LWN1TIhubEZ++94FQI7Vlfm\nZVTwjsmibCFSFHFLbuaPd0ZqLS/sKlQ3kR/Li+Y7EwxZQqUYTlN3jO0r7Rn2\nSAIaLuruBr1dIUxg/Y9TnXgHbK2za+wmk9iP4KP+7NI+YQ0rY03RFtshIg1C\n+rrxUL2zKyUpmPuE/f4iRNTKTCijAT15IxcJWfOa+htrTsnFtrYR0fzKE8iQ\nWL9XZ3scetHvgYEy4JrpNLlOwp6KsG6Z6D3uIlEDz9f4xoE1EORsKtWQG/Fh\ntZZyzRL2UBrdgXdWpnrVC7QgYQZoPujBds8KrA/8bLMNBrgxtyCpem1nr7N2\nfPoT19FyY3xC0OH63SdCH3oeTlXSuAYPjp23ZcU/KIoTME8Zbdpxy2zIa9tc\n2DZBdm2tXN2bOB8u45x4O7+Noi+NvjVndX/uFlwogmj85hqkLeR5O20c8twO\nqk3rg/uR0Jx/j32QwtyI9VVXwN7RWoabjKY/X23Rzfo+tZbyVH936kHW5XVW\nVJUXop76OkvwdIG0keZ+wJJMMpwZdPoLS0YJ+iUGqnsSaMlUoU7quIg8GuOT\n3X4X\r\n=kxSi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2dc3a2efe561ba73f170543c5af486278100778a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1139"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1139_1588699218322_0.409596223091232","host":"s3://npm-registry-packages"}},"0.11.4-pre.1148":{"name":"piral-pwa","version":"0.11.4-pre.1148","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4-pre.1148","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"195115495f8687ff3e605efbd2980163ce5dd21a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4-pre.1148.tgz","fileCount":25,"integrity":"sha512-yvp6q212Y296pp9iAJDnaextR0O8fbsrNVJQEWnCQOfsmy8qLLLLHYljIzGpeI9pSNygiohmNtWS7PLF/VqA7A==","signatures":[{"sig":"MEUCICiJ1OcFH0FeSFMMoPFb5Wnn+ZpZjy6cuFAzh0yiKLSmAiEA5H3wViK9dizisZmkL9qlUVGW/JRj2X0JvRvzpb6iB2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesp/CCRA9TVsSAnZWagAAvWwP/jrbmJIFRRoLmb+aoYXX\nzim1B/6OTT6jPa0xeWwlnhfRTkcF9PB7+WTN0UMMOGxh6xzGj/9ylaRGUYtO\nBwNP/ZU/TslmYQEbDHoCEQhZDuWpHIm4443tjVpeLot1+Iexe6l5U+gOoL+b\n1yNOSU7LCWZM5TZuF7CRJJiTeFYGwltGn0Bx9RSPs+w90HyuN2hsDdLcJvWb\nVIJW5ZsqdIirgEM/ZWZJcKceYfPzpvNttgfUSdfpjb8b8RO4/5C61MvJFxSP\nBkwJSonaMZIH3UPO4Mk/PZSvkoOCjszIsDodj6XX/9BlGiHCRUF8BnLJ2Wra\n6bn4mBAvwwBHiRHaMcN/cUv4/cBp9FVqhK0L6W0IEyWEEs2RO1kGzNvuhM0+\nTYD2gFo6MUgENoaqpRrtCY0YgTisnmqRslp10+1EN/KNxiwyuLsLox25zrGm\nSj31SZumKwo7v0ZAvdbmLspjz2J1AqoclnGP48gexqZcl01ZzCtdqk5TxKOG\nwZs4xeumpga7KMAX9dplFXK3ooR1SdX1uYE4v11hnqn4dmJCPbZcfbKYlumY\nfBGN5wtQ/N5JxnAyR0lUOJtFZdJbGsKyB9FSvQrh3ceSDA/BcSEqb0/eQ3OE\n4ckBj1XtN70KToLnlSpqoQ0Zg0LFl/0Uv96nfG+XfFFVGOWLfT155YJ4aSYF\n5cMA\r\n=k2kM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"321a77147c34a096138b46b09d8f07d71dc8c414","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.4-pre.1148"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4-pre.1148_1588764610017_0.7702571908532327","host":"s3://npm-registry-packages"}},"0.11.4":{"name":"piral-pwa","version":"0.11.4","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b95a3bd11254befe7f95f9d39cafc29ab1721809","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.4.tgz","fileCount":25,"integrity":"sha512-27PC/Zi/q7zaKZqpwVfNzYsvKzmfiZIRwYGMi7qkfDTAW6XARrXOEHD2u4M7RGFRxDJRy621ELbj98Ky17x9mQ==","signatures":[{"sig":"MEUCIFo/4CA2xzJAM8nV1QpG/mhxPTyS780optWB+mRO6GrbAiEAkl+Whk90nWAhsg4JO/yXmhHE168CGll2hhjh0RIp5SY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesredCRA9TVsSAnZWagAATsEP/iiwyRrNjVSZkIG/x5LM\nO6GBTGzWdaKaqXmJrCt3c/RFvtjKja+ylhyOcgIECWwTesl/rsRXcHJgoNfv\nHiScNU9IF7VDzw/ad7gEMKo538dyxzpDYYXRrSYV+cz/zxUGKTPWfiCS6Wn3\nQONPed73vQ3O3lcUMuA28pr5mSQnTSAbnnxsaf4/Kg0G6O/nWDJFwjUWnqfl\nDk6ORli3ATLoe7lpr55kidTOTU6ecNHmPAxwAKcjwhPqhN7N8c24FmbcvGsg\nYFQpDtc8lVeU4aj/ClmsGGpv4Ne926nP9HyJLWim4z0xMDJA+X7goMVx3f7S\n/CDGMMps6QOrbPf70Jw6rpu5zWJ0xxBUj1ZrwZkrlP6OLhvwV1vjpG4PQngp\ncHi+urGCQ2yKiEvA/V+aVdYzPJ4KPtOawkMjlOsGV/pDC1MOr35dkXJ6GRdG\nMheKQtt23SilYnRjcWvUWZsNjgog9y+HCMvDdBP4OjATXdo9Q6mUYPmddDEB\nszfETX00Wt2ZcDeiAZCC62mW3WaKdVXPWOLL4OGlw5JAMvIEwl/EHOPoHMZ9\nGyfM5szy0BIjiCBfaFINf/RV8e+wpU+rMrr8u5D26oVyaBnjYXmH1IsJ/mWa\nf088zlYEUJXPKlPb+KtkY+hO9bqdTLt6j8hELnD1o8GoZ1D6UJHj3CyH+v/a\nUJHq\r\n=6IIH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"f523ec865d0e49fc98375dc223aa893bf30210c4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.4"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.4_1588770716752_0.32704826801918063","host":"s3://npm-registry-packages"}},"0.11.5-pre.1155":{"name":"piral-pwa","version":"0.11.5-pre.1155","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1155","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1ba3267b95aea0f6d648b6805ddc3783fbbdf76d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1155.tgz","fileCount":25,"integrity":"sha512-njWqNyKkbuA9ljbTVTXNUwVnpc3VBTpsKvxoisTeasJ4fYRG129IRmKVapoO1tm3GQoIio1fxfLgku2wllJSNw==","signatures":[{"sig":"MEYCIQDBJS6+x/j9VRAsf5IGaeXI2fzJn7kGuAKV54/+jRS9eAIhAIdl8PkcEbJF86eQVKn8fhrKNUC6jwhfpfZizMvJWvvK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJes9q0CRA9TVsSAnZWagAAqykP/12k4hu+7N6pDqJ9gOr1\nGuUTRJL//ziI//bPgCkC0xfl8YX5dKFtA/qG0WOHjVHNFEm1hampH2CwiOdm\noTSux8WPYPyApci8SAxb4KgihdL4BL3tFfYZFdOOnVsTXM/iUlr8wxnTFORz\nlvD2IkdDyqHSlYluXWtKJheKv7O15Nqu0Hr5SaGUUQV2EHoocWJd8CU5Mu5f\nMjrPawztuoWsdWm2Gl2lj4AwxW30GxaowV7ZP4Iw4ZUspJ3X8nDQy2QYTR57\nfxc/pk5QGLShpQcAMbUQ/gVw1DyW2XhX4c34m+6EIt9Aapi0/Sqd90yAa/GR\nMWHG7aOmEtpuV4pyqQp4acMEXL64OSlKNzEG+GP52sAEJRPRiHRJNTJVaJV1\nlvzLRXYAWrHMflCeqnxxL+xtJrsh00ldKdmSF+g+wgeJiyZqiCqQ0mWx1OG8\nHasvLvJNNJ88fP7Zanogfwh0Rnxps5TNz1QDRNEnh5iyN6QGJA/0wZI7/8WJ\n+ceazfu+/8RVTvRVp0v9AeKtI2F7saOzPhWka+a8age+4f31hexHBoqMzJSy\nvTiG+NucJVNNONfWmmdyv10+sSdujIs96jR/njmJxDfiWQh8QLe/Vk/iD3eq\nZuhhi+OZojaisD3CGxl7pRkrCgXQE0H2YGlVoLuNIjGwqT7453C7oaC7p5CY\nJ8UF\r\n=iEMJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"49c7c465afe4ff5c075e6b0cd5d341ec617e03d2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1155"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1155_1588845235985_0.19349327364214086","host":"s3://npm-registry-packages"}},"0.11.5-pre.1167":{"name":"piral-pwa","version":"0.11.5-pre.1167","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1167","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cddc75be5314079474969dfc1e0ea76371dd71f3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1167.tgz","fileCount":25,"integrity":"sha512-GUcUyIEteDGWvG14hP/IPAGFbBnROUnLahWnGsrtljdnKfNBN5DJBcJGLIdEQFskpopJQe0lgq43t9H8+oNUTg==","signatures":[{"sig":"MEYCIQDj0L8gT/O5wS/yAPVMVnfD7zvDIGbB1a/qluesFXRj1gIhAI9YIrltDFcZQl/uU91SMKBhqVb6YYtBcnacEHCK0qoD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetz4OCRA9TVsSAnZWagAAQeIP/3H2Oei8sG4Jq6BSaVZO\niq3lirrYs1xXs3n+bd5jVbif1OkdbPkQRaeEW4h1pyTfwrWZEBbuj/sxSS2J\n3/5odh3V9QBcUfJQvP+3L6DNpXZdIXezQ3nzrnqSJCwnOIdvDpv4Mz2z/kQr\ntPWaQ50HBLE7wDczAZKRO2xcY/g/+k3i/GkVij9Vj0U2A6LcpAl8j/C9f7Sd\nJI9dK/7PZnR7D7ITG4yYZShi9MLJJ+V+55klQ9Npaz8om9uNkJlJ7WvnLPO1\nMw6FSe+K0UJxgZWaiPVez/2knry42QHBgg6DLex3R+XNm2ukLUeUfmX6GKnv\nlIHvQ/+xu5qPUJWzG1NgnujtB86ta4/Pl2Apm1OssDnWpjZjD3HAnaA5dtYb\nWu6szw80m43/jYwBR+ad6SaA6hqMqWQzCYD69zxlJUmrVvP3gMacOiHx5j8J\nnVQJuueGow7yvBkWqj+9hRxOfi1cgEAHFeOWF+inHMktUBLs6Cd4mRMZWSvD\npeSCtLBOCvNa+vRhHYG1HyhmfwY7nhN9y50DhzZXr0RKisXynryFaNLJdCL6\naUeFHUi3tv0fyb187q0cSnBiypwnnEFhj+GsWN7WwEKQvwrYlUEW4bSzAp15\nM5nbsDYj7sTb7qAXbospJE6A34FTnSFuAq5pydEGYQddFyjK5l9PiJ14GD/l\nqDns\r\n=kUY5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1950b265417698707223cd3e95e1b49946bc8a02","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1167"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1167_1589067277828_0.1758313462329042","host":"s3://npm-registry-packages"}},"0.11.5-pre.1168":{"name":"piral-pwa","version":"0.11.5-pre.1168","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1168","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fbcf3e9e4d61557589b633b8540ad44a0c6ddece","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1168.tgz","fileCount":25,"integrity":"sha512-wqgFQ+Crt2vltJRlF1jxn9hVsus8izKJ3P8qRueFMlqi5yyzYFX5XfpHA4BvkxH8gAlbkxqbTbGchENdQCTiaA==","signatures":[{"sig":"MEUCIQDQ8ck5Pp+SpQad0eSX2gZnAJ3qhraaQZBVg4XafVsnrgIgdFLJ2VWWS7fcojNkHbaASx0OdxmHk2zz2YD9lVHSDLg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJet7jKCRA9TVsSAnZWagAAuokP/2/U9VqCPrSuyiUK4ePF\n+15TA+AXD/Fa8IROMKpusXR6v82Cv8JP4W59Kb+2/zw++tIbKnSlQzGbneoV\nsONl8siRpQR/y4T9Af6gZe+SOEchgGyBGRS5iMf6OXAKk+cqsGIblAD5fa54\nsWsBTZNPX4w3D+exc0U8/YJnnWEri0nID4XsyXtAU/z4lqBzIwtSXVu/hvty\nbUw15NHGgPrVOsbaCbCsQJfVfwz3QyT3XMsJIEJ91gMTTXoin/v7iKHawWTZ\nL9L1Dcp7XZGOv/moRNIthr3kXp47y7kSIL057DZXPyb0Mkd1xdrJzF+COuIa\n5mfD6WG8tF7UFcRuumIItvdbJlGotFWa7GgYe3z7RGzdGZvdQDFdklQ0WCZt\noZispx3lN1JcB5/Jm7yfnOyY3rGBWWfc2k2z2qCYIA78NudbG23OAWbS8/oR\n4e7Lqo4nV68AghQdFRwpLjYsXnIP4ibAaRYEJvjXu39Qf95J0Ek7OOY8dYwG\nRSTeAriNUy2BQhWs3/C6FDREK1J3npXZ9XCEc5r4ttgqlC8BpPqOOGzAj5U5\nwlTffLxvP5FPCQS7NtrMs/DxNwQZ8HxbtZOnxaMd1p455KZn7d8NMXQl2ofg\nvQ6ZP61COBFXHKrvKx//se559/JAKx2bj/c7QIIu+hykwc4PJs+0lvwgjCwB\norwW\r\n=h2oo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"20baecda67f124622a31946239d077393dc78cac","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1168"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1168_1589098698313_0.7749190250282283","host":"s3://npm-registry-packages"}},"0.11.5-pre.1169":{"name":"piral-pwa","version":"0.11.5-pre.1169","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1169","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c45e87f7e06637bc9caa5e4fb735c530eaeb5c85","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1169.tgz","fileCount":25,"integrity":"sha512-yIkPMSJNXN/1d7gbL4rSFPqdLyFdZv/3Ykkz7yJ9XBUkgoheJ1ZOMFxuMkL6OlgyhZkFt+EgkKe8cZ1lsSeSzw==","signatures":[{"sig":"MEQCIAjjGl1PFVl2S0lyrEq+P5RBG/QxVS0DZgmcLsZ7tJvwAiAOP9NrXgJ8LvaN8mhCreNCmiQTBDLeSZAfGZcZCk5p/g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeupkbCRA9TVsSAnZWagAAszkP/3vL/TQZAlMnllcOKEDG\nKGOeMKtA9NcwahrHmgnFLJz1qwajVnE/G5FVKeE555LPZWArBiBUDmZLDJ6V\nTlUb6trduNctc55bg1Ao9P6phJh3MPRLJ7yUha9taLm68as2MkCIJgBy02VJ\nPEe0NMCHZjYxT8BBGKkThUsg13EJuNxMIuum+Ndv0RbOli1i3T0XURArruYr\nZAdrSoESDudjhYRFPTFxFH1tNDGDmtdWN0XWEWdHTiuySiKO0+ugYHfSLSGf\nWWIGuY8PUZBJfggwuDZSlaQ/BmPk6cvtV1mIJeM46GAp5i7Nvr0tsejhz7gy\nNqJEU/vyNCXGcLfJEaaiRTkOx9F/HeC6zWz4z/fbjrKHoIASwgNRSKMnKVSE\nHtPlkcUYBCGA9RrRWiENbTjwU7V+5eS87Rmec0fW9VQOq7aWgGIV2nFTHJYF\nd/9HQDsFxKgmbxeTxOrF+XtKYNjIZ2hn8wY2RiPUm+MRuJIkNlQXIgZKwHD/\niM1SoVQi8lWVPpFJZd+vRv25F4DTh8amWERx9XGE4o77bQiv2GQGeKWcQjpK\nPS3swSBDex1gi4qm3v3KQNqYBPAbfyCpAkut0OSSSURDw/fgYA/vNMoIJvga\ntNlI5YhLlL9RzwKBlUP/YBsq+qwDf2OLaUB4QdeSFgTeaCTmCbRUpSBkOJmu\n40LY\r\n=zqU2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0263b1f8c975ed206d4b0d33b3cdfccb69d707ef","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1169"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1169_1589287195159_0.2687031479693487","host":"s3://npm-registry-packages"}},"0.11.5-pre.1176":{"name":"piral-pwa","version":"0.11.5-pre.1176","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1176","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"51402bcd826e0d2445771407ae4449ff8cbc92a4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1176.tgz","fileCount":25,"integrity":"sha512-izfteq0YqIhHC9qfGHRbnJjYDS7mQfVCpIWW9JMf/v0MvufMs6eAhf4VjYmAOALrNXbvJShbLJ3C2/HSgAxzgA==","signatures":[{"sig":"MEUCIF0Q9aPmy8IFnwETHp4r0yXkwDwYV81GhoV63M+Mj79VAiEAhqnvKXO6ukvAj8qbLu8jmPDxCUANBqvbYRczmGW3/T8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevBrSCRA9TVsSAnZWagAAL+kP/3jUz636zv1oY8h17sV4\nitjYo/9NPnsxtQO6o8wmk/IvqWwWVLAA0SgRk2nW8zLO6kHEt+NskORk5E0m\nMAKGYbEWRpDX2vq1ZLnhHb3DbZIh7oKao36RQubIGHyfaFPxbxW9GWrPK4l3\nD8bNJD2xMfYLwo80TYZOr3zg4J2MsxzVkrqeIrqs1GmoZOQb4L1B6JAW1Q5/\nqK9ap0YSWi8QgHV2zKwXoQJU7nYOIxTq8drjZoZnReK8XAwadt0djVww/S4r\ncaWo9Ti80HeBs23jXJ8lXkKSklmLce7DrItap54ZSo7zoMGLV7HXnNfqEByp\nZ3Ym3MazAz3GH3rdek1anD+tnR9cr06xVpI8Pgk51Rf6TBr1KHzi33M0DLs8\ng/PEcCtACCXfSfXh4tPjoWRa4eGby1kM5TpK206U1K/0nx3OP8gFoRVUu4zV\na98j0VxLzKACaZzZaJg+haPjFEGKlyNevWCBoot3EEGxywoujJJ7IID0MkHU\nCm3Iioc/WiCpiRO2/V43ooW4dDqirM3ZVpid2taZBwSikcdp60D9rbPxCmhB\n9selYiyqBEMGLcGnARHM2z3FOEN9nNFP4imEykfN3auoMs6YHQlTjHtE15S0\nfF6oPCn7wtmz9bmLGVGcyPXPDaOTcfo7O5AXu9YXijOID+hoPNT2HlbeRPpN\n3Lle\r\n=HZZm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ff199927f448e971c6d542850184f5c8a1fca6d1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1176"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1176_1589385937982_0.4645083581045619","host":"s3://npm-registry-packages"}},"0.11.5-pre.1196":{"name":"piral-pwa","version":"0.11.5-pre.1196","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1196","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9aab546249191b595a6de7062982a0647618eaf2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1196.tgz","fileCount":25,"integrity":"sha512-2O1uzBQ1JvuinTANTtet9WPGZRBqKWSFcl3gnfow0w/lWwdmrADGJNDb3S9D3odhu2JavvSmVAbeilckdXKfQw==","signatures":[{"sig":"MEUCIBmyrI4jHYAGgnOXxYOoafT3uKFGDz0TwJIgoAFiZwhuAiEAsc/8BqwcjBhJZnD7xQm22DMwymlYDT09jd9iqWr/UEo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevrs2CRA9TVsSAnZWagAAagsQAIkDmkrOQsiG7/G4VJr/\n3UyZH7OUXHz2XnXdEJ3ds27aOYqHSDqvfa2yZvfjGKhCmND7y0xnHZDSRJqV\nzRLEgCJWsu2z1jTN9/uMu321U/msI9NyLTIeSCytXbFefXxlfG51OjU+HDHB\nNezxYa3kUxF0oHR93avVnaM7mmtbA3tiCl2SunRc7ghtYPMADMuInxr/xMHG\nHJfGKGDNiCNj2Ih4RuwcSngNr95nI+UKFnJcKUpogtBbykyFxnMNzqRmhBEi\n3r5blMvSxSbUA+ppSVSsd2gIwUb1vqKeJFj2DW9r0kYSBSlAlQ3IgqBh3/rs\niZptm1g4I0OTawDDkevcwQ7aecX5HlCGF1m3qpZGg9366K2bLAf5D2k4G1kO\nXqaoH7cMKYB1kusST1F9D8GoKsemAn6iFJg7R09pz2iniUlDnx6GowB3E9r3\nON2lINcOrPr3xSYqLO54tUDqLIIbHwNbxT0Kn2I7411oHV3nAAbcuaeQWmTC\nxyBDnO+GEiE1QFN9Qd6mmJJL1oPWurQO1L7kJB+33EhbMY5XblNtNmluI5DK\nDAN7kztJghUHovH5eUepVItOWF61nAZ+x6SkY7rUCQdNykCqExqXYpCg3LtL\nI8d7OtJ/r1/0VYy7DWlU/uOwVmZn5PRIB7VHesHwLoXghD4wSjOBbQ1Mfn3N\nMdEs\r\n=MEos\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4f47627b317e218147ab7df6cdb40673c94c80c1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1196"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1196_1589558069834_0.8018556618011214","host":"s3://npm-registry-packages"}},"0.11.5-pre.1201":{"name":"piral-pwa","version":"0.11.5-pre.1201","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1201","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"52b75ba1be6630b03d0c8bb4aa2e89800b757d4f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1201.tgz","fileCount":25,"integrity":"sha512-cRwjjIhdAeCglQSHMCldOF4oyDS+0HsG2plwt9fJ8pCEiVcwYDln1sH2CvcuwXelG8oODdyV+KCBIpJDlzhFaw==","signatures":[{"sig":"MEYCIQDCfoh6YV2cPAkt8WGAGhITaPyk9uvfyux95jzOmkHP4QIhAJirRWoJRI0cC5PzelhabpT6tjVXLMqhx1vgRRpITolD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewudPCRA9TVsSAnZWagAAs3oP/i2xbTMECSZmuZJiNGMk\n66GdtZo9rtTqnW59qbijsFEd0Tpv/2HcvpeUuj0aJZSNXRHPGZ6CQr8aYadq\nfQfyQgFzgFP3jaYfJUyKLrUAFSVW797mrkiPq2fWqNDQwTmwzeR/8MjwHNE6\nYX58iSSXgdhZj2QvdpSCO+qD3CO8sJNFQF7ePvbTA9ZCKf9T21gEY2qust8G\nAsT6sEMiNzZJi8wDjIoytOvXGrAWqV099FkeLr6Y8y03qyrABaj7JtL4V7F+\namxU8V7vEuhyFQVAiXX/oHFGAvVUdniINgoc7tAABtjVfvYooq9Zjf75blg8\n+sTWi2ytAyqXMxbEyIZpiA605x3q9VZ7HCRo1II88hADHH8UQITHqmhkBunL\n4NO/2vdFSQyw2PnKmKs2bbw9G8e+XhQoE4HMzTyn4WoLiFtNRWTyv1y+w7nc\nBl9C83pJJCzK8bIQQOMv0sjDajNzdmhgNz5V0u56C5Gf0uhk8heMwbHRntaL\n6n1NOWt5cNjJ4CFDnzr67y7impdIkV0WAPu51M3+zdIfW7I8dFxipqXjNJw/\nxLu7TyPdDQfAXE+p1+UFrD0H9Gf/bY+sCQL4cRD0ed+PJVPlFeB2LEVEDvuS\nEhP1PgFK1eCzwZ8UXnoQKgVoUTeH/cQOr3keJpmVRCv+taNVCNdimhTXLVBL\nKo6E\r\n=uqwr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5b0fd7cd6f1ba29b9e07eef011ee0c158c722282","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1201"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1201_1589831503055_0.0009266659244446807","host":"s3://npm-registry-packages"}},"0.11.5-pre.1203":{"name":"piral-pwa","version":"0.11.5-pre.1203","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1203","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"00d6298e2c5502ef79fa777b9b4e9e9e8df8c4ac","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1203.tgz","fileCount":25,"integrity":"sha512-IIGTQCgYM8n7DKA69WpyCtDdKqbxwD4CtXi+wH970qKuxlP5iziWgzie5iJuLQ3U0Ip7VbGIToi6JltFsHR7SQ==","signatures":[{"sig":"MEQCIHyLocJpcGZMRzD8TEEWNxmkbiKKAA+nKkTbIz1/sny8AiBgzmpAQXYAyd5DEPNAdz2oaaCoOK87yzMjSvTZoARygg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJew4TQCRA9TVsSAnZWagAACYIP/iE7yiSp2Z/3/WNkr7I3\n3loDLlFB/yS0MnTVZdE/XzfC99pFlmPeumVeBNeGjmTl1W2xBcWnD3CHkJsv\nCXjLDzvXgkzqB3Vzmnx5JdnWBPGfUYd+yTs5q4L+r0Xixf4xaGC8HVXKmT3Q\nlyTAB5UhrIP4Y9luLOqtYa67fqyZ+X7jnqvKr/44fUBUB/jYnE/gkUIJeD2d\ndv5eEvxJUOl3XOId/+YAtHkTtRtELoKyr+ggBvbLFzAlHeWn9UTii1fOyRTc\nqRB5WDcTCxWeIZrUNzvohC8bEY8wiKxml+AwOj0q4nYAeKxEUa0e77Jg4ct/\nb1HreSyVLjnGllYNXdFkTGfc1X0IY17H4wrXC0vsNVO/zrMM6ZWTUmf2O9gl\nSdJ/AVGk42UH+Twk9yRkI4zxs2ngZxG/GvDvgHc7FZnENM2vVTYPSCZth5AD\n4q1ReOtduYJ4dcgJ91QTO0FXv2iphYgpznlJff++PJ8gAEl6brI6MLNVRqbd\nlvdKZJKMSwfNbWYhPsVHwbF3A+9Z6nY8NRWLuiJ8adA6//c117ZKz3MKBY23\nXZpqqJz3CjMQvC6nuP5cjP7yikSsBEAmHUJ4tXk0F+6pENwbkjYACA7gTxTz\nbAYONFEPq1rv2U9G13+y1WGHdOq2172cBgYVZVu3LbRsbFV5Y/GfkLqYJeAF\ngiOU\r\n=XyBB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"83412a884f6e0a29891e85eb059ff449f51bbcd1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1203"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1203_1589871824029_0.15944019117593156","host":"s3://npm-registry-packages"}},"0.11.5-pre.1204":{"name":"piral-pwa","version":"0.11.5-pre.1204","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1204","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"23be22521fb5d1433d319bb6f94442eb8761a828","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1204.tgz","fileCount":25,"integrity":"sha512-dS0m7L86aomrnl70uTQlsG0rCMjgc+NGLk3kQjFLlaW34jSYpKbwCP60IVNC20NSaY1P9IbP+gpEgVKEpS4fOg==","signatures":[{"sig":"MEQCICaKidI4A1dsy3j3SJ06wif3thMvNxr1jOcKP3t1OYFkAiAyKjKzlXpkiDfIGY/r2WdB4YIdsYDAVlvKtOvdfriVfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexDK9CRA9TVsSAnZWagAAqeQP/1w22MzokLNPt2xo1mG7\n/H+T1ZQYUNeo9qjlfoVydiRQqEXGwHB2b6GGv+nxnmID92T8y5MigyLxQovh\ndTR9/9RL5aPZtLpehSP+VXerwfhJAKbMtuF3MM3D9kiet0kjx+jiRbJCBgo+\ndij9n2YuG50rvdOiVPUc3yau0NSEgbjtW3TgBXpuRpalYhVKsNaX95yIZ7TW\nYWf/FmwPpjGnW7hxl8n/2gg4yQ3BkYVHMmuMazw6gK3tZy2kuLwnvTAPhIqn\nKY9ljI0vdfSMNDBh5lgqGGpepEZF8uAnQf2zcBXh1KXlDzC2PTY9oOU/duR1\nm3m0whT5Kkv4g8GdkFsZuKbkYYOi5+iPN26nvepandfGbPSE5IqUsQU/p2FK\n5LWMfFoissozzna3UgZ6d4sN/p3fAsqAOlvJ16A0Mx5ykaBlN6rhVECdJXYp\ni/fw40kmcHu9A6W4Fyd7X1DBXdssq7rKy+yj0y9u884erBmYxltTENrVIDCX\n7fboal/qvgRcBaXIo7DFpZkLtr6h3jCQnjApIBa6ToCNxffZQvwMUvC21hez\nzHRovX6GNxiXnKBjZbE9T0LJgCSOi7vbXgMAj/+KDFNc+cHGNT2OGCPZb6Z5\nhevVpYuiwf8mJtfA62Wg3ZBGIJuAKJZEICLMTl6TUv4LdzeJo6jBSuaFZzRr\ndW5G\r\n=r/rW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2562c30b2890a785df141d860398ae59ac935ac8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1204"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1204_1589916349070_0.7116451038762595","host":"s3://npm-registry-packages"}},"0.11.5-pre.1233":{"name":"piral-pwa","version":"0.11.5-pre.1233","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1233","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"134beb51cc4ef4ba8568c8496c60eaaa3c04dd7c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1233.tgz","fileCount":25,"integrity":"sha512-48qFcSq8cYxKxvici65xZGpWj6CNY4LKR5rEIcuHgYxaZs6lSjhab+8x0FjY69/7tzyc7U6i82Bq+fmVtTfChw==","signatures":[{"sig":"MEUCIQDPslaS/14K9Bl2sxWJdTFAgFYz1G0urLZAgLZLrO27wAIgTiHKeBXURQPtZTG3evIAAOugnmjfC0gq4xQuFRMfrIQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexp54CRA9TVsSAnZWagAAxd8P/ifyzYR8Nqvqq0DBCSEq\nGwxPtYFB9Twix+vQq5qFV5wTjWQ90ECAUwM7S8/0ipWpwtGLBfQziCLOY4Hk\nuYQdoEvhhaNJ4qA9f5duxQtrGc+Tyd5f7WxQj5OUiWXEhNXngtYanrUQyB3I\nh0RZ9R/Iy/6DiqwRS/EjmFCj7v8ofsoU/NdMRpH8u9xtkTyq976OxcbAAGdF\n5m94wA3fqgPRR34X+zOQ2nHYoTJtYqunaloSnZZsIlBsSlkameymma+RjSfS\n8S/0KNREvTqy435HKKuHNnwPgm0XyR5TmV7pIb5MCz1ZKRmOaqRXYnTI27HA\n/727oCDYtZbmqrLQ+cumEZUoqTdsJxRucvyzdbNm+kiTRXj9/W6UDTwWh30Q\nYv+OJjTrre20926r0SvWjbfTAYveJzqe5WOKoK0u6/nadX1EnYQr5LCy6VjT\nq5moYhhOctFZqaGz8/D88VZutbaz6MVDMiz826oyhPYnOgYkrMscX/j01qDP\nSEJhQT8g9AenIi+7T9DABq9O1ZCr/UwfiGSnnd7Pr791lKWtPgW0ObF8/Y1G\n6MORQ9koHKfcfJgUzGjJGgW+1v+1rT6oEyU0jBGOnu9/7rg1ypKVgZHnBmpJ\nE6c+7EGWyNyJzW/DnfjpKMbw28GiQag9218nnPmm9yHIuL3TrYiBdYvb6pyO\ntq8C\r\n=87Qm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8f7a439009e34b485bbb5f2a4e8828252ae44b85","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1233"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1233_1590074999932_0.013226227650039446","host":"s3://npm-registry-packages"}},"0.11.5-pre.1237":{"name":"piral-pwa","version":"0.11.5-pre.1237","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1237","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"245c040d37284764800348d023472b91d1c0756e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1237.tgz","fileCount":25,"integrity":"sha512-jK2qMW/fQcpLRIrVF2p/cKqa6Paw/jP4zi0aF1LJ6rGViB0UCr8+l4/WzGSeS2zVc4fsjEA61lYHlzq2StYVEA==","signatures":[{"sig":"MEUCIGScgEwLNmR/HFuJXCzIsUzBWFY96t6Zrq19R1irKBytAiEAk3YAGtaqYA6wwg3jCeFdOyFs2rQLJT0m0oy8PIQXuj8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyCmLCRA9TVsSAnZWagAA3jAP/R2IVJ42bLVCgjs79hdi\nvFR+Mvt2AwV07UrnDnMrLxVxBvveXlzS5ChMKIrBBPFiVNmjxIdt9Jp73Hat\naCt5JYDAuwLvycUuU5GsEPsZYqrcljiUXVgmK7QH/m0rVrHfjW5SAUvVZbG1\nvxb4/CQUMCRHQEUuo00i1fXESPbHGWU1rZy6PHJPxnp+XqFxwatsL8rUQTfP\nP5NsO5XSiP+nfBWN0SPeoets9x+f5tYeU0A4NuCEXGiPUdcCPQy7HHKPcZZB\nLCHMljo0NGK01JmKFORdxtzeDHMS0cId21etgFTp2lOdPd4Un7K+p6FCaDPb\n3Phd+mtDM9Lvy5oKDkNt4lqVY7+LO7oJYEPAYRsI1pt+p3YvN6vDwJxlaZw4\n0UV7xCV9OgALKPsTEPO3af9jIhJY3I5t/xoZDL5BOllcxrngdjKlechr4NoR\no958WKlMJ9hl/BBpC4B8qeu/cE/NJe/1dzFoWw6v4bt+iaC5PjrIs2wdLw9q\nfGdlsSnZc5ted5CwWMx+2PtVAgiHvZW9pWshXt6HPf+gVRsaPdiFqCL+gtDC\n7oLJkihOIPYDV3vY0cHup9HePClVRAKuc536dGKItcEMcuWQ+QqrghHGHBse\nTr9ec0v9SuI4rQSpyqXnJS8Fzt/noNq+fm7YWz7HNKO10It265Ux81d0q5Mp\nY8Nj\r\n=D94p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"30ceae60248dd969ea2a3591e221b06cde6ea578","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1237"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1237_1590176139122_0.8856012902118329","host":"s3://npm-registry-packages"}},"0.11.5-pre.1242":{"name":"piral-pwa","version":"0.11.5-pre.1242","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1242","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"31bd9286a6e4b56de97569a52fd0792d63a58d0d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1242.tgz","fileCount":25,"integrity":"sha512-a4HWyw4JdKdQWDHeWkTImFLyydaROdMtWkfbqfcxCf7gx7V8PpiZt2/yxI++azhSEeQGthbRz7PUgskvModSNA==","signatures":[{"sig":"MEQCIEFdjjkfdSp4kH6hXRhkjy8CqEliawcTwLXtzOo3JVvyAiApbNrcwY6jQUp9/qj//s1EG19P7aJZ7OfgB9AS62dIAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyRdeCRA9TVsSAnZWagAAYk0P/jLtSTCUYTGnpbvfXNtn\nUFibiLFzcr7pe3ZtbIeBWYRvBVXBLQP55ifW+RMe5W1/mjmGjtylxW2WcsFb\nFirSqsZBpzH8UpsmB6EcCj83vyYZCBjC5PGAj395NKHymLLs9s/quOkq69WV\nBSD9aPjcdyIuojLWrJ/1G19GQWzCHQal9BxSX6kBvZlr9/bnEbosOoUqVbXt\nyRW3cHbYu1hYTVON2DoqguGTf7Yborjzb/O6E8VvseJbDlMGsVA9W9P6H3NR\nzrCeLrbAgTosLbDnB/tluUcOTWG3Mf+wQSV8CxQjfO9HlCXYSFhSYKdQ+CCV\nqZDhBZRR14Kq8AzN5wuKTIQItbPg9xqDMzSUc3KH2hmbpZeUeIB2ToUaBA3C\ntIcMMFZC89jZfIyPI5149Q5+03qjxdhigiFGkBAXwAfZ7yEBtP8pkVAoNUTE\nJaw18rqhVRst0tWiWjHn331LaaO1moSE8kcieQ3zhCOakLugYd9NxrTwLuxj\niOK9NxFC7O9VKbkLD5BSaREZ77Wj91EWT9bDY2H/BxoGqx+oJVuA+OJ5V0rx\nFSnutdsvHPqSmliEariX1QBxh3UeA1p7/etkgTNNX0rYqbwT57FUa+cZfXUm\nGuPsq0h2fhLA3jkkHFDWx05vbggym66S1bc1FnRO59CN7NTOTvCCr/w6BZ2X\nAhDv\r\n=8g/n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cb5d5846435a0d111fe20c54cc899a17b173af2b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1242"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1242_1590237022571_0.9719625325422914","host":"s3://npm-registry-packages"}},"0.11.5-pre.1243":{"name":"piral-pwa","version":"0.11.5-pre.1243","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1243","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"01aa42e73aa54c89b67225c71e0813d630c882b7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1243.tgz","fileCount":25,"integrity":"sha512-YszCCuPJCQCziPhz28zFLDvgGqkZevKpI2iK0MWhIkyIWGpoHUS9O+9FHSuOQjcco7BQ2/Id9Vic0ToqHKSisQ==","signatures":[{"sig":"MEQCIFuCh0WPRZ4JWhHBDwLSYnLSZvzq6+97rcd/jw2CKwG8AiAwbgIMmJZoMMupeZdAJyalaHPP6EIHUVz1LQRjMg2I3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyZp8CRA9TVsSAnZWagAAg88P/iyHtETihWfSC0w9AmeR\nQ+zIGGE95q/bSyp2vmjkRBE5iHfKVLfvVTvJh3vlEEJbfMz+s7FK1/qFlPHJ\nNvuXdd2hbspGCWbhKrSPaDkKi0BnscgzUdPMTAe4oDW4uU5tZqQVTTqXg16v\nRfD8a99DXKeIR11r6oZjCYmBzebePKfEqoEGT+XJxenGccW5+dGIBpkxw1Ln\nBkGx9eo2noP0vM2kt6I7ldOaQMu47jibPbPaG0qtuoscQvmxYQXsxEn1rf8E\nxRmaZQJbOSdy7CgQPdQD5p856+D+LEr8EPn3oUNdIIu3xKlJlPakOhYhwMU/\nTDu7cq+DmN31o6RjsR0vV25+WyrEVdp57xD5kVSYAnmjFN4tG8sign6LhfXj\nGCM4RvgdiR3njz6KMReLansTzdAd6HvsLnxQ7UJp//2i7wCQbOJi6cQ/eiWE\n6Zcbgna3eVvUBYkC0u1IIx/btTAzz+woeMTOI/iCA6i6CWz80xk5EFPejFaJ\nipS31FSu5E5LFP0HHewpUEzFRIERM9s1+vxiicgkeqShfTU3jYZJuuII8vWJ\nPKHOPCPOTbBelDWT88wXOQjncNs95rsHA4RIPoXXaWOwBg6Fjouw+1Zj7PTe\nHdmN2EgFnEMyTordYwuuWOpVfz00ML+EheZfsDb+Vlr9Z5f9wXMbIrumKA5A\n8aOZ\r\n=3uxB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"dce3c40b90d922f8123abff6a763c78b5fc90ec4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1243"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1243_1590270588080_0.024952813567145737","host":"s3://npm-registry-packages"}},"0.11.5-pre.1244":{"name":"piral-pwa","version":"0.11.5-pre.1244","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1244","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fbda6e8c9918a98de88fc5b08d7a12aafd9524e3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1244.tgz","fileCount":25,"integrity":"sha512-RHCnIHqTmRHJ4I50JdhA2GTAAUiWy1vjl1o5QaIWLtFmmfvIUtWSGYNNWYvX2ZxPFDAmy3Gm/Ral6YwD2FAsYw==","signatures":[{"sig":"MEYCIQDMNNj4fDex6kAPz8cS4BtZ5rvEIuQb1TQQsdV2sBpJ9AIhAKHrB8SViF08BrGnbZMkRXg3mfXOlGAHRoA9hOEfTqX5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeybUuCRA9TVsSAnZWagAAzRMP/0a2pCPmU3ko0/hmH1P4\na+4lQSQ+ZWjkYf8omXCAvTISjmBAsId2if1mOUICEnWMyIvfPCP5wxx5JrCG\nbjqo49K8Es2jdZDmsqut0hXkFZjnNOzkxEQ7+XZglIsldeS2/0047YrRkncQ\n56OS4JWvoPDPwDjve85kUWFQzoE9iMwOsMnxtx6YLxFiCKDbcDCdpWrY6RYh\nm4Qbl3M5HO/VCpStm6mdlsrj1rgWpAUc9OLJMt3+wa3oF3LlACiLkMO5hD63\nAzUbWumXH4viuqllufuFGssEsGbPGagmYdOmona2/T5CPn+5pTam2cyMgSl9\nRQtpOjawgdJl2FzFAlJvzHemd5bZmgfIrOqpEf/DmxcYPMqZ4pH4TS9Ennul\nHCX48DBYn9mwoYYOvRzf+VC3B/O1bm0S/LBBKpNMznowMEHx27f5rZXgJKZR\nQ7/HPdwA3bRv4Un7q0QHf5vSA6l55bbnKuibNDSCbJQOxKsAxu0NF7K9OcmH\nNAJMm6c3x3owIohgF92P3jC/PZCnq+nPDmnafLnM85EFKAn3Ubx/7fOKdTUQ\n2oPVsuwVHxZSWkGJqYahE/INJIgflDTugP+uzx+Kz748CGf38ld97kuJO0DB\nIQQ65Zr3nKrlRG2Xcl61rPJzfDan/yb7MbItuoadGIuCqDnyQ+xB7eDbtDWJ\nTjre\r\n=l80U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e62a9ac95348f6a4ed5b5e9ec3a01075bcd63ea2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1244"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1244_1590277422011_0.9441524465848112","host":"s3://npm-registry-packages"}},"0.11.5-pre.1248":{"name":"piral-pwa","version":"0.11.5-pre.1248","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1248","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7d81c5f50f270491d20d0b525144a54acede5f17","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1248.tgz","fileCount":25,"integrity":"sha512-btuiotPED3eU2LaAZPd/OT0YnUFNSr0CP8czceEBYGuF55IHhUzaob4uz41JKe2nWjJ9a60zaeLtiTAQHJpIwg==","signatures":[{"sig":"MEUCIQCrYgbgUVGFngh3sxIvqVFmeb//G3ZxJ2lszc8Hwc/zrAIgWEw140xRysWnc2Ny0f5dtLNwjBadl2sAb+3EUOJBbzU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyqLCCRA9TVsSAnZWagAAkdMP/jhCCLY//sQ/8lAL9yub\nyH8CljRp0vTljhmhS11owQx5rp9QgdUCn++/Lq5SXFUjN8rRbGq8eLx+iPY4\nklKnYRPriDqyCgXZiA2tQzYXnnTPwxkd1aLdOkKlf/q2Db4kKsjGhCLY5Zg+\nU0PKVUFjwLkmSxeHNf7/OYBr6OLB47g7j81Px+YFZgyGh23jO4YFrJQwh7fR\nwUab4NmtQ2mRrSUGJkx8SoRTHijTLhpKmYIghqUtKuaBCMTiU4BLCVXiUS9y\nM4dil8BMIi2rmgErw75ZiyOD5E0MIj9Xfe6aQd+jqGJAvYSH8PcYTkJQ0qve\naCreZVjsKsclz4WrVOhXoO7vN/QEMSQ4Sd5hP2SYiwkk3XdXKXZaJK+YDy8g\nJf//FLxge4U/s7zl5kXxfuUmLyBmokldLcW58hEvFZkCInkb+v46p9sHbRzw\nU946898FM3vsl9ajSdd5Wm3d3McEbU9lKRn4CkhOpVwZLqQzfrVcXjnLTUQ6\nfvjCAQorcYlFX9zAFMRztR0w4qzRtPhjiQ48ki2gHwiIT9QBy0pf0TMYMOoq\n7VowzZ7Td7dvo7SPQgdVhK30vCr2wDqWRrpNk3eXtlKGS42btZRYJb08kf+X\nPQR/w/LRSxku5Ajl8FGdlvWLy40u1ruyTtZzWYDhRVTqkYew68zog9kPya0t\nAEsU\r\n=CVnY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8ffb74f782b7244d4aaac51f0951cd99ab517a90","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1248"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1248_1590338241901_0.9535778244894291","host":"s3://npm-registry-packages"}},"0.11.5-pre.1250":{"name":"piral-pwa","version":"0.11.5-pre.1250","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5-pre.1250","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4445a72517a0c9fb44d54445dc42f1a01b50e691","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5-pre.1250.tgz","fileCount":25,"integrity":"sha512-Wj94MUwdRylUpFg9wx+xOm6M1lKwAsE1X8qDjCAtwKHIMIc/sdWE6Nw2QRvcerS22vZ2gjOoR/6dpRWmcQphZA==","signatures":[{"sig":"MEYCIQC8DY16zIFnaw/3AW649EP3FfVaQZshs17u6rRiYFytGgIhALLFR9LPgqQGr2iDqaV9ID22hxjcULQxl8vbdM3w4Ocj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyrnHCRA9TVsSAnZWagAA8O8P/2yil6wxlDP8HEnK0EKu\nImEVhFGMV+cydi9/sj5eVjFR3HEysL3J4n3JWIKk8ypu02L3d2b9WqNMntP6\nchH3hZzel9c0bD8sga8aqDmteoM7gzei7r0pQ6kUiL7wDQmZ86AjnmkNcCgb\n9vknTV/YjRWyNhuvVyc9LkNcCWWHF9+rsf1bv8BzmQKPussvG1Ck9iGy0r0B\n1zvmWAisIRqx7fkTM1kqwBFjYU/A+ib23US8z+/HuiYJidzqii10UVwR8uPs\nsAmosIeC7UVrFrhnVKcMZ5Rmoqw69rVUn5D/3JBwiADP1+dfiTOcJM+zRaUO\nBVclB9sXdvU5M6sHGKK4qqKbWDt74PdQiLnV2hRFMCAMW0JFhSdh5yueJg3M\nakLKIXaEpIXxtWMDV/pWBrjA8CF3dnXX6m7P4Ptb3FvF4VLSnkNeEntoQAKL\nieqoAzNUYj4rdFm7w2Q0UT/EYNCMfim5jJxYRz4jjaVJPtkmU4I+GnohJ+ps\nQ6iyUrUwRmN+vi7aaXc/8z1GWVuhQl5egBh4rSEMpna0J8orsk+qsCPtsAg7\nhaEexKv6cEIsD2khffitsHpYa1bq4oMMQ3h/kmHY++0t//QbYYNLLE6MgiGw\nuAcI0Z74z9juDL24yGvn0s+84QC8AFQgDk10i3jMxI/wq91XNHfuJhh0AtG4\neWoX\r\n=xIfz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3f61c14e3877e266b081c0b3f536546a52a41360","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.5-pre.1250"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5-pre.1250_1590344135064_0.8092839837928067","host":"s3://npm-registry-packages"}},"0.11.5":{"name":"piral-pwa","version":"0.11.5","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6cc08173556eb52580348a5f95c1a56b7ff23927","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.5.tgz","fileCount":25,"integrity":"sha512-Gmtw1wAYH4rhRabt9D0uAEGiaodHNtMqp+/4RGbHz0Y79ZxRPUnCL7Pfbma3XeVDe49UmOZ1DDCVVVj9Q1NZyA==","signatures":[{"sig":"MEUCIQCK8RatvVt8IyGLTqBBCHEz/V4I8iNxP2kUeGvQxr7zrgIgTzgIE4sAk5MiaLVo1bL6YI0GUF9GXrPpWBXzRdAU5zo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeys+vCRA9TVsSAnZWagAAPLwP/RouDOHkhVdMTR3C8ZQ+\nynIvb9R3z8nYe0SyHVntExHqmWuFvKLHhI+X/5sd/3IB9mZnbsykoRzAkr28\nuDyEvuFYbhylQPsoE6LIs60PvmOnV1BE9rPoLZbQOUAnhpKNTvSGeVo8TqsY\nlArgvBRvca4iAzVKtloFs8Q3oEkzBBmU+ry0nA0bFyuuj9bJY6cMUU26BF6a\ntu7YmPtFee0n4JEuUzcG52lZH4Bf8GbJjeQS+HgXVSfJFvVhpYOz35ZgMX9K\n7m6udrvkAPsdPrUYH2U0vyPqjTf8YlShlyEwO5bTg8FiluFw18NtvCMTvPH5\nm07CgYSq2FsIWE2r0hCQquI+kk9eUyrspFfZBtbRKwmlNX8UX9FwMJtJ6q80\nzEdDHPDPsfOpTsFaIzGVfb0Qh3FJWIPEuSp0Q6fYbux33SAQvEZwpdxXzoha\nOjS/c/bBHJMARVvE8aP0BPhbGUN1iXWAzbad6iaRUDe7zREgu1za9DxqhhLL\nDtD26Dw8+2TfXVx4e0W2G2vYg6/f4XH0H0odmsSUa4jW4HrR8TTwuT+8mdA1\nHLnQtkmA6uc5lwqJyJSHJLRak5OlAY3NljFj+NYs50srwkmrKDylpZFcHKmh\nIEYN98EcsY/zgjE9cmUAcdCyvD+aCXA4IzodTcPzXh6Sn+Va3sVjjxp0JKIK\nv49W\r\n=ckK2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"1415cbd981dd5f6da4822c9203a7ac6073e3fcf7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.5"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.5_1590349743010_0.7673729490318688","host":"s3://npm-registry-packages"}},"0.11.6-pre.1254":{"name":"piral-pwa","version":"0.11.6-pre.1254","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1254","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1382460393fd3e2645672d5cae422c86fec4ec9a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1254.tgz","fileCount":25,"integrity":"sha512-ilE1VMVSs+6riFFG7pJrfjhEipMcSZjLKhs/ykbK/Nv4qhJrlg0MXYtWVNWZdy4z8x/s+EZJocPNdtkm4/uBxw==","signatures":[{"sig":"MEQCIDNnrWqkFSQh7l6vXhUXQhE1qNbZ8y8GVFt2y9nxLgCuAiBbR5LsFD7jOQyyhOexbcifDfKX9jx8UfkRw6ZdNGGLPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyvRFCRA9TVsSAnZWagAAjr0P/iPW7dVehU4M0owYG2et\nGeDLBDBbK9QQ2wjpVuq3iQgQACuV2R54gU0nxzh3DnD7ldsf2bD5w6C9XtGm\nm4Tn1zFEMbjwt/+YBmqgyRJJexFONXvhkT1kMSKxNTKW8RbNdKTN40V6MRdZ\nFB1vXrFYvr/fLouIXsq8QacdzBKXmqlcZ5fzv4gRpU2xp21QFumjUZTaEN5T\n+jp6nqcV6YsZ2uumejn4gkWGbKVLx0zCTKxxXXpdsux7g4IVqk9PSpk8rPto\nA2gUt7t7k7aFLzT/ifP21MROYiJRIPSRF3oLOwhCx38vqYo2dStpzjwkeO7T\nmi+eD2pUwrlV8LXdAnCXaG7zSVbPRplNwyIP5M4ue3kG8sfK8uecsId662Qb\nixXPjAu/N0Sr18bSvQWizkRLuVVdL6ggdcYB1MW8r1eIISWC35bvp2dK3Q2h\ntUhUeTw/0Uak+7nt6MqY6AFVA7uvhE2Pcnr9ElqPijxlsucbGEWdK92dh8OS\nngl5XbTmHROhPm4S/Kxoc/mIsjrqmAs6mrZA7Gh5sTWvySuYmA1IkMkaQqx/\nnWSD10YN7cInN5rt/uCGFPahFgnjbmCPVWhza5SFLx/jNwrexPTOrVZX/0Pl\nFGe6lnRWvh9ZQSF2uC7yrgIpd65EGv+lvSSbMHzce/vQwgd64nEamow2ilT6\noW4n\r\n=b5b2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c3b46806b56de2b05e29fa8714becd1699184d83","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1254"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1254_1590359109572_0.04992499494648417","host":"s3://npm-registry-packages"}},"0.11.6-pre.1256":{"name":"piral-pwa","version":"0.11.6-pre.1256","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1256","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"de84ccc487f0a99f595865440995697835b0fe4a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1256.tgz","fileCount":25,"integrity":"sha512-OiJy9+9l2qj+TCSZCtGM2px+Y7602RY2PYIDByK8tGeQVSE6Et7+P98dcJ1wIdY+qNr/65udpOuDaOkkOOEJ/A==","signatures":[{"sig":"MEUCIQCzor5yzFH5khca/1U8NiyGkwzj02hHT6FDSdNlXzZMTQIgWCl293RvGuxWSptjubk/NsYBe8v3oGo1XVbeMEiRy/Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezEHXCRA9TVsSAnZWagAAeOAQAJsSchuUusjY6hoENwUo\n2SAwEvUnnymVJYuIQvzjNptMWV8hQM5tqOGxmvnYO8ZCqk4XrznLM29CO/cK\nAncRuRrZkTzozK0Pc7pcdedEpsN+NOYdefYmEM9tDtKiFmRSnxETdTThCx7M\nuJSe3L5SqWPUU382vjwp65O5JKqD5e5KK7LQ6E6sje57pibsQwRrJzxwE/g+\nVx77/Q9ap65x5IWTA15YUawSYu7LCMRkFH87QdUVsowFt4v+RTii71Hck99P\n7TzLhjoqYwV7rET+lslLAcovPGLa2sjgGJ9bld3dzDNx9JPXWahEBWYYxD8w\nlZjJw0FTYiuT+JDzJZzB1zenbjm73d1FsV7HsamJ7z4OSCCsflUhZuqgDr9e\niFTikd3tbqtTRVKnbTwrlZfJIArXeAVYEmfY0hYhLDo96XbIt4cAvQ5v6AMY\nUc+SGCWAA8lPt8R4vNA/R8McVvs9KjbFv0DBxnmi7ZLcZrLOsGiRUpYlXpmH\nbgf0FNt7wFXds5ZLnYgtVS44pcxeIokHH2Ryz7K1Xxs3WnzBmwNMtPbjPl6o\n0Qo7J7tBrvBT1cuh7FO23IBdvNOw8/x8PPo4qPrqRdDVmMJGvwW/pkHrJW0L\n/oomGYV3C/EdrevkfYIPSupYkMkLRupSwn4fc5sLstZSZsmS0gOarHNU5C3S\nAkNF\r\n=3388\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9024f89e0cc7daa04895460f922eaf6de5a69ad2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1256"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1256_1590444502852_0.8131914977337424","host":"s3://npm-registry-packages"}},"0.11.6-pre.1258":{"name":"piral-pwa","version":"0.11.6-pre.1258","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1258","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7260d2a2b3bd79afbfb7083506d2ea4f91426201","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1258.tgz","fileCount":25,"integrity":"sha512-x9QM6X32Touw3W3BF737x5rE095rJzqQ9KVZ0A9HKI1UAgMI577SwCNw8Eb8CqJozO0hP+UdaOIVrs2iuDa6CA==","signatures":[{"sig":"MEQCIFfLLMAxGrK64DF1JGlOZn8Y9PUZj9NL9WqH8ux5qMRyAiBKWAuC4X9k+F+NC9h5INIHQZQe2sb3yDsL0PeuOzmDJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezY7bCRA9TVsSAnZWagAAsUcP/1ujZINK8Bx81W6J+EVP\nCUe1Vjg8695PK9wvu+6RUqozMnkQsyLciqo1qgh6zDL055ehujo94THctVBN\n/z4TJRooipawyFlO0ZBZJgsZxUR+uprKqKmWPlCfSwFVksDupJFKjUF+xD0I\n+Q7nlBJ5DObDsnuYiWVnG+/UmNeM9R4N1YFTj7IbNmmR60ZDVWw5ePhQLjlG\nd6lB5WQC/bUmk9nwFQa9iFm72jcP03D7rPmjb3sItFoHObSo9zQMeweOn/rr\n272abDE5YU5Zzt66GTvLXMU1mn1AgcCG7IgFhwIS4PARFCFG6Zw+E2pFDETO\nbfGVWQa25/Y86iuYMVNT/ey5guZu/YoxWbBjhnhG08JPBVjVhG+y7sWo6UfH\nhr9hdiEtbEpFGhxU6hyrYnPGpm1ZKiVfNixDqHiVRpkk+ug4NCQ2LGg299HB\n5xWfAF/CxMRKBzMNlHkBvewFJ5DF3bzZRs6+2e6cp3W+qmOgUzP0r/uqbZdr\nEYpNp+3EjXbAcclAIDJLS0YooW7sMYGVxefw7dK08uXztIfRolBZrSbDaejz\nywbbAsEPQjphaZVb98dBQFtuu0HRorGjZDBj1D7aQrjyoUvxpxIavsx9hutO\ngpvGopbUa/fq9o1kWR6BQu0nv2am/3HYq6rYoAAvbiggu76gtakz9uCNyGjN\nm3ku\r\n=K3sB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7d085afd4dd54a4a14a88af6ff3178eab73a172f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1258"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1258_1590529755019_0.48713657576362324","host":"s3://npm-registry-packages"}},"0.11.6-pre.1262":{"name":"piral-pwa","version":"0.11.6-pre.1262","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1262","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e59996e013870e89c44e096582264834486ca5a1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1262.tgz","fileCount":25,"integrity":"sha512-uy7YI7jtDYnybPkDslgeayTjAiYU1RSvVS4mZP7WcHIpBpoNCXQUBf9i2MZK0zBGvKdFO4/k7f6LjWiNbfyd/g==","signatures":[{"sig":"MEYCIQDiS7eB9TyGWmmt31pl9jBIAWkkGPxAo1tgJ2xW9TtB5AIhAPLdMB9edIUiw++ZgSe/NSox7cWqii/IMCUpHCnIQMoB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezmjZCRA9TVsSAnZWagAAoNoP/iEoM0vCHeQrak+RRvIk\n/al63BzF4UxncvIIBdNHc5SGRNXCaXj8iKdOLlLhywiHDCaGw7YQUMCU6X6U\nt7tUqoBNgMciyE9iLpkT5EYwvDKPhRBjAwN3CMO2J+uCBW63ApiniXDoKsqU\nmxKDpbuefPRBroGAtE2CJxU0n2HWFNoQAVsa3I4rJ5ZYuLIM/fFJZBQ1hLRk\nUcUc34lBoWHgCYqwIRzGp1v8wM0f3r+ptPuGPtTXr9WfrGSY+v5bLlXyHsJn\ntmCsa35ehODg6c7DyXQnz9hu0gHEVe4xJTtGLpDPrkKdUfdzPRTfgWBoVu96\nM2GDrDOuQktcIa9UmKjF58r8C83Yq1RM7fU8bOauDpAhL2WJVkAdKf6qfgrY\n6DA6sYos1+hzvA25lJy8A8I79w10BNvUG/RXziOJjiv21yJglN5pOzq+uI5L\ni4xhOOMKJYFVwm/HdmibFxoyZXZgPlFL6gRVu1wgNcuTO0kZKvM9v8rGbLjc\n2sTrINU6ulZQD2IOZ+W0I5ZdA1ULSgDgy0+2cdAWBvD0Hint88ckVj/6+l8K\nnVCFEs6PrExBinoEvElDO7C/rQS5eQs94LJnAhqWfJYdiGxXELjcyI+hqY+a\nNyIhp0Ym5KLJzOBRgYmefSkPK5da/UOoNBvThuelQI6mLAnqM727kMhf4UGZ\nJ0Hl\r\n=WvtV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"57f96952b32108c312b6179ff23c85684f89a08d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1262"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1262_1590585560764_0.6033549891785952","host":"s3://npm-registry-packages"}},"0.11.6-pre.1316":{"name":"piral-pwa","version":"0.11.6-pre.1316","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1316","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"75296236f72468fc6d682f2a3f3c4ea812e77212","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1316.tgz","fileCount":25,"integrity":"sha512-7+rkn9gT4jpBlEYp++kiHXGfuY7g9ON5kIKNH/lIgiDtAHYLzNl0StoS8qRGOywU8MrZagRYJoz4kQ/CDOPhBw==","signatures":[{"sig":"MEQCIB7kHXH9hEuWLPHBFC8u+swN19GiOEVluvQjZPRXnU5VAiAw6UYbom3xONpXTE91ZgkMK52RJFhRomPv18rTBfp9AQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0EQaCRA9TVsSAnZWagAACIgP/3PAdbDYH6IemKgImz/r\nW84IwMF1U215AoiY99kwenC7URbEDL6TKH9rscoYK7yJejiYCCTyUb0ODfaF\n4B0sc/cV10DklAVFaZEwGu9OoJg8Abiy8qOXL/4Q++8YJGiwgad33Kik59R1\ndNeCQi+8/d8BOIWv2NHn6kBtbW8YDsaz+/FAq2dy7Elr1SYlQ4vT86lNpVSh\nz4JskpxtjDzclVaKgQwLle29uKQrg5D82n3Rw0gLVTRF4wpCMzgv3+n7Ehan\nIRZYA3yuMR8FQbfHZfv+E3z1caQ14Bg8qWORJTeeYd3dQSbfyFZeYtFO+WTS\nt4IShaFDAv/g8enaNQlqLnR4de13vG6oD+lMqn+LVQBWFVwQljWEG1iHdP8n\nFDTl9gHaP4jOHVe8dRFdYILPDC0KrqiHVKnIKis6lCHZWHwiLzcpxNODmY1k\nrdW7b705JPdNxMI9xlWuTuTpXAWwVqE1CDCy+J/IwoRP23/V4WTY9akeWEzC\nmr6+rzxasTeqy5qUGxyHz7Y+axEkXtemkSHXCwRxLpmyiVv2cOkOAwchsuga\nZj3s1BdNj+GbmNkQXV4+S9he1BR4xJvvc3ARxm9l8fGcBcVlULXHO+IZUYve\nzo/9nDNCeOKMvMTVa03zeau+QOgS8uLispbX6p5fLQevVVelfji4tIzVdOTw\nyrwC\r\n=UIBw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"eeb85280d8b6c1975c043abb12dd2436ed409fe5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1316"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1316_1590707225320_0.8705477534746573","host":"s3://npm-registry-packages"}},"0.11.6-pre.1320":{"name":"piral-pwa","version":"0.11.6-pre.1320","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1320","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e8281bc6b14ee1041e4ff815c248dec207490a6b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1320.tgz","fileCount":25,"integrity":"sha512-Qg3aUkajVqfSi+XPt1HcctJpshtD1WXi2YP6VT96SWv3TYZBD9DEm/2Uh2mZKMGG4wDhWvD91S92kQzElgJPeA==","signatures":[{"sig":"MEUCIQDEhqrxmCvR8ZxrjzlU0vOhYmn/cQAqYiZ2kSvP+i1JVgIgRCMgMDWppfwUmSe9eUPVMuv6uguOVwVSuUM+FapvGGk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0TlSCRA9TVsSAnZWagAAeocP/RqcjOxPMMskN9cmUmZW\nOH0GuxhIPDoK3VAtolTdxou6YV7Y55rgjpTKWAY5dLw9VpE/kHS1SWrUAvhC\n7IX39x5vwUluK45hLdw2SaRsHAeAXJ9POKVU1wgtdTvV0Fc5F5B90sKyQAiu\nVfnkxV65kl1y1mLjGJhWu21djRhTCuJmI25TnKd720RBz3PRHQbFf61/yXfv\nLqtakiGBNhsNsXBV2mw80y98bKUGatOi8vW4YPwuof59mwzVM0Srmfl7nONQ\nXFAuEQfY0dnuc/vj2qYzqApW96YNrPA5zgdVSR2YW+dXquGJIRzRwwopBliA\noZgPsuSrJ1BTBIWtwK9lKXVQtusoCbsd2Ddpm37lNKtz356iZXGsjwyHDVSz\n2m6Tve+2VzRabpMGslSjy29PEc2OQGiQqIIhECxsavKm/DGQSirDtfBgfqMe\nSU+Qd1N3SIV2aOOre93DgcD7Flnlcd0nSJzKirO7ur6cfm0kOX7Of2F/jcZs\negZco3fWPvhZ9VcGdtxZNPrEQZulCCaDcFhha9BoH/xYF5g6vMMwpjasLnVN\nLoPYPIdpP8QznDsvMJV15uZaV3rCOphyCt4BWhS2dSPPH1TLBASYgpUxxQA1\nFDIgxiT9p7D4+kWV0ES3xfdjDpZkliAH9zPAA0Y0iNBVxEUIC32VHa5jQ7eN\nFU6q\r\n=ecTA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0076e4c666c530008b7a820e18e1817012c890a5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1320"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1320_1590770001820_0.8763199041364731","host":"s3://npm-registry-packages"}},"0.11.6-pre.1322":{"name":"piral-pwa","version":"0.11.6-pre.1322","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1322","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3545bda2b9173831a7e75e5f9c105064082990c6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1322.tgz","fileCount":25,"integrity":"sha512-6fi0pVNORWhKeZJRrwnojOmK05K5qrsCsoh/NFaRGI1h/Mi4ePJCaLmgW7GEGCjDmEVi2gokfH3FB9IWubT1cQ==","signatures":[{"sig":"MEUCIHFiX0qfvd601Dylh8SgBOMapTMfQvds/xNtRp/6NpYFAiEA1vbSsIG4sneDZnSE6KsPgs+tOdtdeuseYRvEXmeg27U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0XSSCRA9TVsSAnZWagAANgIP/2JuB5neV5nMOCfOXAI2\nF8zXT4ySj6PZFETBZH5g/qVjn972UVsehGit0RO+mwEqG555GmQcoyaU4uLE\nYJ9nspK35WV+T9MGjd7omZNjkZ+e1m99JY9aNHD0DsZ+BBWUNN5Z6lUP3KHy\nmL4mpR2B4WLsrkSMznEo42FVSnkBHE9/2SIUDNdS63NBFxT+TRE4mllJ1get\nmDpEnXfC+T9htQ/ly1xRhYEtOlwEACuSY9o/neRmX1RvGj39HGrE//ZFzrdf\n9xpqBvx6laqwF74UHjcoZEeYqWHdcUZnYvn7JiuPO088mbgqBWNgnADQSqcy\nRVXdIVR8+CJ08NNvLpufrePsy3cEHrhdquz1rc8OKBIID3U/SvVTatLyNsLu\nMbnXTuhKE0vo3/JcC/N5EiKBvoDY4lmPMWBZy813EJHifu/x94A8utKe/UJ8\nRLaAe8D5lpGMsRU8sIwpNTBMSdjf8F+4hoBiNzHrt7wYuCDyBseJ8g7rtRCv\npTlCrkLtq78lLaJQpJ45YcnVxh13F3w5/czAN/Z9Lao3xY4VISQCSy2Hq1dk\n3+Z9NEjTtb6LIfjwYiOvIr7WFOAgWCK90B46vXpWpY6/U0GBbg6cf1OoItzR\npf6YSY5neMYxYFzNvkUOKx5PO+1DW8LkoqWy9HHLCbIK16dzFaU6moaFgQ0l\n+Yqo\r\n=S4oT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"da50b6a8ac845981a5c38cef9f86d1c400487648","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1322"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1322_1590785169796_0.3423498881817053","host":"s3://npm-registry-packages"}},"0.11.6-pre.1324":{"name":"piral-pwa","version":"0.11.6-pre.1324","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1324","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1556a6a88f8a52f29956b353732263478f177608","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1324.tgz","fileCount":25,"integrity":"sha512-/a2IkyyvJE9G70KQlkDzCyrEVO0oRkMp55jMooPHngN5TEST2/r+oZhI6/7GO7I4Ge5d1H8WpfPoQWYZ7Ukj/g==","signatures":[{"sig":"MEYCIQD6OXl8tA08nkTnKXVMg/CykK6hBMShH7ZA/Gc8vYIAvgIhAJMIB/kvnMn813srATl5DpvU8ycMcUCaG62wNxePesif","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1fMdCRA9TVsSAnZWagAA9fUQAJkTYd95MxeZlKTxiAZY\n+bw3Yi3m+MwQqrFd0KGU5DaFDgj+df3gdwY97QJf72aaSWdiuXsHpNjXkh7K\nHqv1ZTFP9Uwab1Eory1OFjh4C3DMsJ3pFVmgLzZxHSsFcWKKIeC9+eN4avY4\nhKL9wdJsfWBKNbYxF3nC3y2kiF4fEx4YkD0aytJlrJ75X48obGzxXKw8umZJ\nXWp8WEf6tk2Bb96wvWd//Q7JBV8zYzPFEl0/epPW4bC4MmtCy7m9P5wmpVsK\nM/PK28+FLxVq5v0nWMkMNnPQg2iBXBlp6X2MJ6RRBWK/351Wby3YU4NAX8fK\ndW0PscP1aLhYF4AQpDJfc0KAim75LbzkT5yiIW4NngQpHNMM0ybn8IR6vCeP\nLZn/Fx9z+r5qqLpwgEVKPqCxbcurnfh6SA1TEnxDY6FF9NLFkz7s4pyLXM4f\npyC3QfZbLGOiHi+AsLlU0iG/Tr7aJsHQKWx1ZD9vi4VyI/oO1SFvlajA9/vH\ndoZ2sA8Bs4wjSPQB+HMQ/1KsqzhwV8XocIOWIP5t6bd//f4CYSWKX4fRGTDg\njDYlSEuFHgf4ZiEVuzE8QG6N85Qfw3SwYGfgcLEvFzqe18AGDVLaK9/SZmcg\nBI5Sv90j+eiGoKm6hJMwP5yIISjKaLdmtixUGOn0ZaYMwseokE/UGSJOL25p\nJATQ\r\n=oxPd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"310e40de68efdb9b25af6326ec0bf156c3ee9c13","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1324"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1324_1591079708725_0.0593342685557412","host":"s3://npm-registry-packages"}},"0.11.6-pre.1357":{"name":"piral-pwa","version":"0.11.6-pre.1357","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1357","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"73eb5a5002cc7bf2f22d0d3aa8f5241c2b9f5dcb","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1357.tgz","fileCount":25,"integrity":"sha512-3XXXRC1RixIEtKIi1kAJp/A+l/oGM4BOLORXXAD0xrrMlAyitEPB85kTsG1JDkbXNkK/PiJX+Xd0qMfqWiT37Q==","signatures":[{"sig":"MEUCIQCKjsvJWYpAMjSue5C7SrUpPky884q3Albr/EkreKZdkgIgdVUTf/PNWIPZO4zeza9Rv4DVgglC6B+wUAaSnC9L0Yc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1mPWCRA9TVsSAnZWagAAaZoP/2OhAcM/pxtFu0PvcjDH\nLEQDj5jkC7/x/bchZN16LVyequC4vnYd8lGEmS82WlRz6/4b1Lf87EN73ya+\nI9ICLx84tLn9QCVAhefXysWfyMI37/ru2g3iHmGQ4bHz3sQct1/DBoW1TH3O\nONPBMUb8KDx4AypPN8fC3m40SX0ceudpWpsGoe4WC/BsERF8KaGO5tmJmPGP\n+seNkFhatFhpft4QtoerRmmGhyMW1lzQ96czFoYvvY8uBAapkZM0coraN3R8\n1wZQmilqKqaAWKbi5IUyoqXxi3zu2IDWdEo6bEB4ZN3bETclLCiX1VvVIKq2\nrSACA3b6f+hwaUslpjajMl2znv1xqu4yK53cr++PSnpkRe9U94xxap4t19Cw\nMqr2BTsdjZlSQ1oTFIlgpmp3a4n9g8GrAfwFDK+2gaGzosNhzVdFFyNc+g5s\nHcHIhr/0XwESpeQb5kRFd6oJ5zaNEm9hs6kIh/IScG6NfS8C6OAD5GZUmVLy\n7rtoVHeeLdvoI6tXtAxlwyfmG3dlYV0War3LuJufa3K3mieuz9ZcBL2aQNw7\nmJTu9RRi9wT6+AyAPXqUpwoGcFpclpF6Sq4zj9+Fs8VyEd3FCEcFumTUWffg\nX8CTTr4rzd5H1R1g6CvEKeWmkyI7hv4Pjy45wONZJ+EiD/8TFTnZRaVoWTzq\nyUt9\r\n=nLYN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"12666232b5aa8dbdc1972985620f4efae5c1459d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1357"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1357_1591108565697_0.042105453018629335","host":"s3://npm-registry-packages"}},"0.11.6-pre.1361":{"name":"piral-pwa","version":"0.11.6-pre.1361","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1361","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a4f6f1fcf8e103a15eb594f7ef710950b4c5e252","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1361.tgz","fileCount":25,"integrity":"sha512-UvpjB0djUFzgHe2p/Cu7f99homTW7v6GEQbzyjp1NhRQmpctFQxHgB9TaeAzVrN5SDGHQaE/4rf33k5gI4jN1w==","signatures":[{"sig":"MEUCIQCSJcRn52o2Fnu+bke1IYwPsVyYtWZJG4h3XJSwdi7ZLAIge8z1yf/BEpgkowNPqR354PJkgWC6RNw7ms/Yk5xtmgg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1m86CRA9TVsSAnZWagAAXkIP/RszozTswT7OqlA+uNrI\na5SpsDv4+s9SKvHE0pieDU7qAgTqvetNwo3nNgaR9V+g8H/+XD/4cKlzTpuD\nvsNf7u8Tk9u7qBmj9YkFww2gRPyABdhyJWsGsUyEchBZs/MDTMvTfoIWTXBu\naLxXR17S1M4STOHLVukm/U74LhZUHFfa6ndJlSl2+GHT3jfb623YXsICec0P\nkSQ0YvOO2skvDBGYLVzIbYXldqJs1B0TrIX8nMizRv3fJpa/1KFmA1XnyAzq\nojnpCcI9kU/mICRj9V8FlqS6OQtX6sly8ZcmXZ+M9/eg7llirDoxpdwySeL0\nDTMTlVH8EUOzOC4iyS3v4Bpt6SXwbVuYIZS/elsrhWBzwVbu1OLPRpfmu0ik\nop/G8ogV1h2GPTD6U8CFAakm78LsImrOhD/lqfLxRJY9OMy/bC1meUns2S29\nfw9tBcHxiDv7+UnrRoGJKy/9Cv2Jy+cNsD91zYz7aThlON02LBIqrNsMi+wb\n6XYDBrdHOIunktfh1HuAhjbiBy46n0HabtIEyVC7rIaXMRPe35plA5nbpuwo\nvG26u0MdkYiYSGIt6evs0dXnwUWS+G1c+XkKXzW0buaH3l48c3uflcJMgmPA\nKbkOuo5iWwvMw3AGIRcBfePeFeO9xkdPN530CCCcwunGu7r19+P9A3Kj34wL\ntXz5\r\n=DU5A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3af9e744b7700113ff35217fa06e5c2e08113c4f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1361"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1361_1591111482595_0.8480606916027262","host":"s3://npm-registry-packages"}},"0.11.6-pre.1371":{"name":"piral-pwa","version":"0.11.6-pre.1371","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1371","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ea30485ba259b70af70787c69f373205ce03a59a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1371.tgz","fileCount":25,"integrity":"sha512-QpGM/PbFumKIFAsBtScMx41CRrSbSTs0IxcMITLJjkBrDVktUWatFyWLzji8NoKvdxzgX1bnulK68tFzb9xvGg==","signatures":[{"sig":"MEUCIE+QRsaUGwKjknogUV8KYUMLpstYeZAcVyS/HUn6rBNlAiEA3xEFjxppHhEVtG3qsXBcHOgUw30s4nuPXvmEhsiRYms=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe11DaCRA9TVsSAnZWagAAp4sP/3wuqbYU4OuejEV+kF4l\nMCjQAwO6EzmpZpfGyilr7mGqW5pHtrvbLH2gxCu+YDu3ms4eQt77fTVS6vQ5\npfHoNVz8g7BOY+4Xk1mzseJljdGazygOww2ruQpyZwhet9G+w3RmqKPFa/Xe\nBq3b+W5QJUhXICycLPb9vlcOSXjj4coN9neKSMs/rxkGYuxTViIEvhWEwvuV\nnIDiM5WJZLBBa7rohAwHE52X7Cr4bloFzvhovujWeaXLHFr8pVhO9EhTIJ2K\n+TmGXLYD3cNKR0tNVmcpI4xEBMmwG/DlxyyjIudfQDR7V6wj753bnt/6f9oU\nM0tylWpO/k8L145J62FsIQ6kLSsKsehNDRGJ7PXqUy4wBJ85WWyesUr+dOUP\nFLooNbVkYGqzcIzTPAEsToUhuHid/8m7ZkVFmBOOGB4eKQPNmKq/fgTlvWGG\nipmJlfxwel3SnKniw8zTqxUMPdkdiBE14XSjwnQ9NEAAUW3DlGGI6YuFAlrW\nNl1Doku/Isfzws54m35pz7HSBcOoEpoVKa83R6KXogUuWlDDNhTaMUZ/TQ0n\naqQX3+ptH3M3EwYTBNXJM8PS3A8m2AqmvDDP6duuY9pQOZjowvG+ruOuv9Cw\neL7JV6mwMgEH5KDHB1WvijLDl05Hp8h/R/ZLuVKQmxSRlfNcjN+tKqnmVssg\nXjjm\r\n=h8jm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"03de236167ab3eb62fe565fa7d6b4e2704ccf1a4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1371"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1371_1591169242340_0.026758720661802293","host":"s3://npm-registry-packages"}},"0.11.6-pre.1372":{"name":"piral-pwa","version":"0.11.6-pre.1372","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1372","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3e98ac94cca1461d85d59da3f75514c34580b76e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1372.tgz","fileCount":25,"integrity":"sha512-15FDyftRa4DPrD4jn6MPkkJZ9W5BezhWfXW+wSIgFG0180ToXeQwH3/qBOFL8UqyKN7oNLOlRWZNOIuYkbDSmA==","signatures":[{"sig":"MEYCIQC6DavVW2mlN844C9NlJL7RtLyg/+Te8USmtWhTgAlXfwIhANYwfmrv1o7tsu1j8n9pwfF/kC7Gbx/NFcqmP15Spt+7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe11V/CRA9TVsSAnZWagAA0TcP/0E20JDgHDaiXRNiYWz6\neVRd6pXqdCrfT6iVD8p2bj6LlpBF4/AzY17MLua73Kpjb4r6yVDjrBe39JwO\n9kGpyAOPJgC/jTiWy7Y9YIPGmKQeBUR5/U/3g9jMKoQ2oPWRFCCR7EE428pr\n8nS/uFAAdkPPUMtuQqdAbNXw5O8xtSE0Ovcmgl19myGIsAjPfyMk0s0a+gr4\nCzqSu978nDCtbyS3O/ux4iSWF+Vd/4zI3PSrnUYYDFo+mx6wQ42S/diZBjaG\npNlgfbqRM84zqOd44faTTl5hhPnAJBcSSZspVEiT1WtNeRSLAWd0tJpib7zb\nFAiPDBxvWT5z+E8puc+Dzyx4iAX6qXn1rdzogL/kQvKnmSwKQWUzGmsKrdNY\nO0DMAEBEI84TPXvwNDEo7cGIpi65tpLUfQ+nXLow1qNtGlkxaSWKDAUnNumY\nBev9EawKey35CyMxmSgXqKiL4i3HA9j+JWELjOfmoY0T242QvWsni506J6Lu\nxpqJYimf1CXjlbYmB+fz0aWhjZEL43iZbRhCFeubkt+b3Y/rNZpiGpY5MqlL\nxNmeajYXsLUcOOZUPLr5kIGLNeXZVTRCy2l3oGReouFf6XcTT1NUmQzoMuMU\njttxedNBDwASXG8D/NTfKDe5ni8SqbgpiwQLZ10iduwxFmt4yoAMsU5/2nI5\neYTt\r\n=sNY3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3d8cd3549113ddc046ab13bb8086e2abcf1d0799","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1372"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1372_1591170430626_0.6892334524626587","host":"s3://npm-registry-packages"}},"0.11.6-pre.1377":{"name":"piral-pwa","version":"0.11.6-pre.1377","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1377","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f71467ee64252bbb2f3e6725687fdba404807960","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1377.tgz","fileCount":25,"integrity":"sha512-+9YMn3yYfevgPkbuf2kQAlqfV7CClQgieE8mMWEfQAPVLzJG5vhe4LDOHvQQ3Uocfco9fppc4PcXefDYZLqREA==","signatures":[{"sig":"MEUCIQCCMr3OgJ2CB0Jbep3RAperq3ofTD1+sMvy/whfjIUBHAIgGJ3iPGnQguTHj13gfeYQGqSrJhC5yLDhrj/TEv3MgBQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe16MWCRA9TVsSAnZWagAA6HwP/iJr1WSlGFd7rgxbQg8X\nStd1zv1Q2jJORGxPn3GiE+YxO2NvxK23r9+pe3Kg0rt192pH6AqVbfn3tOF2\n7T5CQJ5hikoW3q1U7pbpv0v9Bgcbx7fcDnSl++1YJcI0nMHYX9ROHo4Y83PC\nMTjiMPZm03WoxN7gAVcUSXgzBMfAIM+vqPdSyLeS6Rf/gIBtnGXqPDIbWJO/\n+WSarLKlWzX49Qz5M4EiwxdkYZevowLd9BTkUq/43RRUGQJuwGRDx5PK8qIK\ndhqjUZ2phzPFOEQ+ztOLQwQOpIBEpqXfpkZ5Nz9aBSwYDuG4q1w/HAhUCfPf\nlKQqsKC1Ihp+SKFB/YsgtDYHvPJ5teB6k3VJAkqaByVB43GLBGTH9Cpp9y8n\nl9k6hgysu4jTQOhylY/AFeM9gud0iTNPAFBlOoOKglSPGmRrkFPHoGQEf/VK\neg4Vu3V4tqRH2JeaarbFxsy2Glz7b5PiKOh+4DqcpGmRKCHXSVLwvI0nizDz\nNDp4a54FxP8gVshWrZorYXZiRMZ5oSzQb9XaNceoyb1V7ROOnm33O9LBJ379\nO9NKt7naN11tWoGTTOXlvV0p7rKrssSG1HPzMQX4gV5ICmuw3pwyM0buVKAw\nz3dfTsI4RqInSn9/2lFHRG0LTV5DnxtOgkylZx6EkPl7PGTQ+Qn1RIYA5fkX\nQk3E\r\n=8G6u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2b6ca04d37512ee8bd1355b40cbcdc3bbebe2226","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1377"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1377_1591190293658_0.12718251712826323","host":"s3://npm-registry-packages"}},"0.11.6-pre.1380":{"name":"piral-pwa","version":"0.11.6-pre.1380","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1380","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e192127b114ba1970f32c8a11c2a194fc3c4f021","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1380.tgz","fileCount":25,"integrity":"sha512-DxS9UYkaiKwMJm87JCPhNOORe6QxMzDLgVWf3QF1HetLuGBCGUQ7xwk3psYKBGSdCCcjqIBHggyDctVBhDiswA==","signatures":[{"sig":"MEQCIC7PgO3xHPUQovPZ/dzeN9GnOFER4tXmSJzOjMP3GUfJAiAqvLuXffBC/JP9b/s8EN6yA5/dMm2OdIiIFlOVFyz2Fg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2JqrCRA9TVsSAnZWagAABR4P/0luzbC3nJbzvygQZxeu\nfreqk42ZSrQBO6NIwxtt4usXxjdfiHZxjFJvaASz+/0r7oLKrNXCkDvQhMt+\nLmYOphdeCC3oAUYBVyXs0pv1qv5LPXFNbHsKqxCu5I6LAYRCFRaXstplZgTl\nIf6a8/rb0wHSZQAuBc6G2JsmbKon1Aj6U+zfSSjQ3p9c1wKtkn3L0ROczhKz\nCzPxp+enG6MRWp6x4t4MrKcA8ZV00iSyq7SFpho60lgwJbo+Yd1kGnD4MmOc\nAWfTj1TiUJHC9ISNSCt7LOWxDoQYmkjgwdCEwKO/AQOKSKOpnU+OIZmpbodM\n91W1FxANPVH7HBJOueXGjkTj1+ywwZwHIbBA23fNIuEZ/LzgWMyVR3mNN3Pc\n5ILk3G7T4HMHgOqq2/W7E8V17ZCzo/ravd91QZ9LYLJQW0LY+oyAEiA/esQd\ngiK2qN/M7AVlNxBflI+XYUCL/lEERykt5iGNJO2d/aqO/MNsmbJHshnNGNYz\nk9Hr29KdZ3UGw8x65rLW0gjtzJeCTTeRKd7tbm/NYCtdnFF6Z5A7bBlkWsdh\nXnOAUih3Vog+OAM2PLFg/R0sE7NpEAO4eO4t7TZRIIKtb9yGTna5ialJYksx\nulohGTRJ8pIJb13vrf0oaq1+OMhVZcd9H+U9MJP1wNs0wQh/FWhG8Ne44REv\nD7xr\r\n=QToj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"46e964f9f287fde8db3f319434b9dcaa439abafd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1380"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1380_1591253674912_0.7272973867998715","host":"s3://npm-registry-packages"}},"0.11.6-pre.1391":{"name":"piral-pwa","version":"0.11.6-pre.1391","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1391","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6ce16ed6dc4c8a44cd6796ea2c50639e9a9001e9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1391.tgz","fileCount":25,"integrity":"sha512-wGhleT7zsiCl029QBb3iIX602Gcfx8RW8qIfUic5C1ooMXJoJp9iut4lnd7AesrKMxc4C2fSag4uikBHetP1TQ==","signatures":[{"sig":"MEUCIGhzeEUuHfd/B+r48YOsOsSSL5bYpue1KqygdQcKGrLQAiEA919jDK4cqPy+IISEECLK2BoZ2X5vtuGUQNQhccvMjBo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2tEHCRA9TVsSAnZWagAAtOoQAJ8niovI7rxb+VkPhfyG\n7KhR0ZUhhdR/jezrRCywjnHKMUV1+LTBoQbO3SipILA3qXu2+E3/Wk7xPfbJ\niJU4Zz9843N2L/8qt4b3RaiaEscytOLvFVSPPh7ENoa3UBymjg0lGffkOECV\nJfFgCGSdR+1vdGA6HtIUXBU+grcUfFP8mFupfD1oqQkUfECkDYVdsGJsZWBf\n+CflxKWCNM3JtnX1/4fLaWq8QGdtYfFuLSmlz7NE55VVRezDZ+C/bFJveXFe\noW4Njrul5n2T0FGumMY13gNziB/9NRZJgPZStbS71J2/3ITFuaRcgxrLoDpg\nQe/HjfV6ycPjbK7usLndYLhmexM1RYurBQrfgM07SFKPaBe19RAAfIK92HBt\nzpyBekgT9U9ytdxmiLbmuIUmJgeVm2bzLiOJ7y2FJykdi3BnNdyCYvfwBtzj\ngAzzksqxbs7dR3pQwW0jSSFGdtD0n6bfp/xkitzv678a4EY9xHIe5aaq+qrj\nytS/1iUWuDifO4/4yXtNWI34sxxHIEdG7haoXBfQbJzaChfz6iyuEN6viUDb\n8HXXotqmT0E7LAKqXDTwEuy9Du1pP/0jEuxrHnw2dZiOKlPTEITQWyetGglX\nDS9YfO/sX2PSd9wGNw0T3Cu5GrFm+4lFOj2ne6CG2PlEUMhenJC3LZ8sIZ3l\nvZ3G\r\n=oK8D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"39a70ad2cb9f6c2c588f1c1fff536e4d408f1f21","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1391"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1391_1591398662705_0.05362788476186653","host":"s3://npm-registry-packages"}},"0.11.6-pre.1393":{"name":"piral-pwa","version":"0.11.6-pre.1393","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6-pre.1393","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"92d043d3f08ed9d5acec08ab5ffbde71c9d8a69e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6-pre.1393.tgz","fileCount":25,"integrity":"sha512-QESQXQtVjVHG1pliVc6BD16oAV74TmAqSaImzfhl9TG4Q26gjz/3wqErTMVMCYj9a6XGABXUzOzA54kORxozXQ==","signatures":[{"sig":"MEUCIGyWaidSomyraD1C2GBNnUsP5ISa3ArivdE2eH+ZmnZxAiEAsbUvblVb3VpGHwg35lhrOQRiFdUan21tT6iMWAGCHgo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2u0FCRA9TVsSAnZWagAAvh0P/j5aZt9LLKcu1IctzDom\nMFt7yGLNdscl+8XjjLJ7w1X9eBWU/e3ohKY1fBHyHyMlmNRNQOnUAYlj16kk\niD9DeGrw1wpyJJvakpwN8RpNetbdCQaNafbUNnNX1sx5nSpmaxd/mMj5GEPO\nZ14rcLElNmiRoSyTnaDTpajsWEPczkYfn40HZMIv1k1B3wi5gUkE1sTntVxZ\nCdaiIg1nBW6SU05iU3nTminkZ5WIkG139keTPrXn75U4/x/0N03XwOr4G/Rj\nA340eUju/MaoYiDVmV3zjy2gkRJlCGGXpU+Q8fuFNe8F9VX/7mgMOHELDF+M\n/Kqin7L2xyvd2946LdOC9VgyDOhXvPgdyNDmmxPirpqH6m2UZ5CujC2cETsv\nn6plHmdmxRzlrS+bwwZERBdT/ev/aHwoZ4cL7klvl0WlPZSXEX73fNBzGf1P\nUzEA7ATceGqNGlSVadbB4kusDpBEcx0A9MlWW6GgO6L1OkQS3gdIlG0Cw92g\n2h1FXW9dqWnO7O1oTCjOBYj54zk/GuIm5yI0nhDg9EokwQ3pm0+pvY+w7AO2\nI1IUVgWGtnrPGa2Hy6U5QX8groYwz7DUnewTmFgVwpzbY3bSZzxyGU8mNfNV\ndSx82HlsmsW4HJXT0UeK1QreLdNvOFuiJf72kOPxZdMjoFjmt2Y5bL17l39s\n8kl1\r\n=ZhkC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"33b8cef3ffe2814edd98123de6ebc938390dfca9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.6-pre.1393"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6-pre.1393_1591405829167_0.4882504294460004","host":"s3://npm-registry-packages"}},"0.11.6":{"name":"piral-pwa","version":"0.11.6","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6f837647ae78a7e5c3e67239986578630d9e5fbc","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.6.tgz","fileCount":25,"integrity":"sha512-r3Gm6T6s9Ny5/KcjygUtDExyTExe7XgejN70pDIbcfEzyo/RD2zDoLt2il8WtZv5snxH4TCKvEVxfPV66U9LZw==","signatures":[{"sig":"MEYCIQCKsMfYDEA/tbnTKJgrCzkkaNgqVQi5dfRaXdXPId5PMQIhAId0VVvA1HFkQtXM8LoGHszdhdgSRpP3++Y2L3LI4z8o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2603CRA9TVsSAnZWagAAq9kQAIjZHjZQXoPdokIVTjm3\nmRmtx42wVn7TbrisVg5mlXHH+ORq81Sg9GuSYUm27pj1p5923mP+CYNWPJZz\ngN5KSaGYn2pE8qwj9OXV4CkHlUaUldQJbC/OKRH4Pj7Wg++tS4XbpAfDw35e\nT/APoKM8mXL9UM153ypPwd8nck1auCO5UFf+Dm35cW76mFb2YePgJz+RZDtq\ncIka6VoJlFlWnfauquLdHCz/6oC2nCJUxj2+eqBFmdjIosVHjXejfxHr360o\n/1wYsxh/DIsGTSvRFuzMTrgWPaEzn4/WPRBznrx8AiMk2zgV8NqdWn1HtxiI\nx6yarJ/qmyrhor6HD45s4SiiWDHK9c9A3hk5YH+1bQEuZzlbHXhYv7EkBM0g\n7lolQDLDbaPRALk51uXZbN4TmKzDwJ/X01xpXKpB/pOWhB+dAHoApfshPb9e\nBCxNJfK1o1TvFR4PuQzLcSilmhR46e9A6SzgHKa5L13OUkwot1DspjvnxOiX\n79sdBdKyJ5tJh0yIhJuK/vp8OMUapuMfGSBlM4Cn6FbIKr6pHbizKshblgja\n75FwogJp5D8Z6NkWrg2JFyvf/f3jUs7c6UwL20VJ9PI6XHICq+tJK1YDpZWv\nq+xTI1D2TWb/uhqQ4MKFIYQTyxPKuemC2g46Hak4qNTdBTC+UBByGhQOOVzp\nT1h2\r\n=Lt5i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"77f45e01cd4c1ecdf3ea49968c305aeb3279a0fc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.6"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.6_1591455030927_0.21088129829768754","host":"s3://npm-registry-packages"}},"0.11.7-pre.1403":{"name":"piral-pwa","version":"0.11.7-pre.1403","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1403","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e9ea69e987b300f8ec7c627c5a6d3fcb1e403911","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1403.tgz","fileCount":25,"integrity":"sha512-lYJyjLT8DIW6/yrQ04UO2Nq+uqAERO+RNrCqcGn9Rur7stIeASpwvT/U3C5zGKoQdYwbNb45Wm9CXfwz0qYlSg==","signatures":[{"sig":"MEUCIAWSRd7KNsYcP+1IBspvTjqZmeqsnec9YWqaKwcNnfpxAiEA10w3HUTKun/Els3LvZNoFso7cT0lhuxpCjj3zKt3T3o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3OzBCRA9TVsSAnZWagAAjZMP/ihYi54e3rGQbEwWsNCS\n+G73YDSdrCYqm6dWzAv7mrHHAh+PR8eR0YO/HeTwnsIJyapSHPeHHge2YFlT\nu6AD21PM7HzNMRta48kwwLDpLZHMd1Zl1i7bqZlqF99lrVbthvHB2XkbJO9u\njGqBix/dUT7YM7dODH46ycgrz99OKsfQL5J87xCS9RVAhrGyyhRAPEjh1wq2\nxaPgo5xBwpHk94KJT/UwStfq4nPTrofNxs6/psgfzVDmANZArhySjLI45KIL\nUB0OlwReAkC9T4gGHLImVFa6aEF9hg5hB6dIlrFjh0Uvz0YVJ3r+74UcFcyV\n/0Jk8wdI2ptUDZnqRAjIjG7tdxT4iBSQ+xzLQ1wSfrYnBHCO5U+Z1iPr7vBa\nASLVQR8CVoi8EYlaMLp4CyRkMd37Ih/HIoCOx8dJs2XvdiqcWbK60Tmsxxr/\nBS6gQvhTsb9+LNVb1YJePSGesCHeg+Y1g8+KIYWooMy2ShyOZk5m8Ts4kP/N\nXoXCSe5mtK7GHKm8f2WnK+mf5iQx+l/24xNO6ODQJN2GeH2XNNNKlArsSeqn\n8LiOLm4YlV0n0tApSSWYxS7U58ZM6HDawQLHZVaLdjIiH1Ihgd0hf95n5ys4\nLmiEbzj0GKlChbmQ12nQHNcOqa9+ca7Dc1W7OOVpsVq0qVuB3Sk8fYyW7atp\nThn9\r\n=0CmA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf57c1d8e95abd14d40007893d6fe864ccab50dc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1403"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1403_1591536832746_0.7382896226064832","host":"s3://npm-registry-packages"}},"0.11.7-pre.1404":{"name":"piral-pwa","version":"0.11.7-pre.1404","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1404","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d6a999072640d0dac61149b8c1ddc030e9f06d47","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1404.tgz","fileCount":25,"integrity":"sha512-rhlxmnTeXtQasElbdlTD9IOrW2OnixukvyC6mvjYx/z8Si7FbaSmxnvwY31idSHTCXl5ooSA7eiDDcJfdxJS/g==","signatures":[{"sig":"MEUCIAfuFL+/+vxgnucHjbMkHoxsXb0D/jN0CwsX7Zui7R8tAiEArXwmvb/ijSMZU2w4qLQA7P7hUemf/XofCZIZh+eO2xM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3RSUCRA9TVsSAnZWagAAZLoQAJC9qeuV6NfJfH2JBCYk\nSBcbdyBWPfQtDcifkB3Tr9XO3HNSRAq/5ZCpTbojpXomhMKa6wiQAZs1UaGu\nbOA0GC8TM3Vv16JKWsK9kGMGWsU6dHfqZMF5M29mfoQNRNAC6An+/S9z+T9+\ng6EZskjShxvpduWUY05NTpAEiZ7M3LT8Bi60pS9T8h/+MkenVaWteCHr4a5I\nqSHNnyG0LlNrsJMEdhTxTIhSft/oRhIju3DNSVkAR47PCXtLZKOYv5/4fF2w\n1t2yDmB+TQHRYz82XAQYNlspgkrDiW+QUuFHPI1ozjbCVRLY8tkGVDV5VwOm\nzN3JvXZKDmuWVo+x+5P763Z7y3/XJicjFzddgTvKthT+EJGdBbTZkyKyu3aV\npbBoH/7PiIvR6I9fIM/JCAfKou18ydrM3Nk5DUCpbLydpUuN0BaracshOY4c\nkrdEqvaSMnCUFKgu7DBPOfjGZwjDohfeIl8IvCO646ODxNTEdAv8oONct49w\nfjRtNhPYqohiWMwd9hu+1jBhXU0S3UtD3HlACRFve5Kv17oo9OWY8LbUeUna\nzuZHFTEXpXYdGP1GBSFvimqkCjR1TZ5pn8TQbNFi+xK24RT/Guq6AmxwntoG\n5j9pTfNW+6HDrTF4BNYiOqMl9+0eyeYK3LKv4I1Bq77Vc+iEYknFL8KQd17l\nueVA\r\n=gFIq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9641030afeb37eec2c4edfeb3e5bdd830156fe06","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1404"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1404_1591547027805_0.39840698655090256","host":"s3://npm-registry-packages"}},"0.11.7-pre.1406":{"name":"piral-pwa","version":"0.11.7-pre.1406","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1406","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"116cd528745d0bcedd4704709e86ca4cca542426","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1406.tgz","fileCount":25,"integrity":"sha512-COX8kRfNdFUHC63OgG5wvXTDJNdsW4j3qCSpQ0i69IYM7YR+V/Eie+rHu0wGxm/YiPYmGQuWt8sTPr8l3feNfg==","signatures":[{"sig":"MEQCIDUxmJp4C/0Oy+8d13H8wFW0NmIOnEFXhWAWFTZOuqsmAiAaq7cUQRqiHjZ6ELOWRi8RIn3jG4s8iPklVyRZd3n1PA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3WA5CRA9TVsSAnZWagAA/dEQAISoQuVivd5vw1z1R0cf\nqS1rZpgl3RGdAWNi7eAPly0K4WywlXXBSz6Zn1ukiBFdiDOu6I6mJQqzfdBF\nWmQFYynxvQN5F+kj26yMg5tA6kHDGDW3Nil8w9pqmW+oc4V1mrlc2cRzSIk7\ngFwkGLuxS37j6nRMfnpR2foOPkUwnjKCZIakGIfVda0tpu1Ic4F+TffAyqh+\n3Aq1VZb5NZs5KLfFlBpmvqQY84XTAmaUVssB6QHmbEDIKTsXWd77617rGVtu\n+jiXFFcDEGiUzyi5B4dqXiVw76ml34nWgjVeqWZ9HbPXs0dxjp6k8+vlSiji\nqfOCAmgX1IgO/30cspfIclZVF9rdtJYYPFcPFPEFgGpd4KzYemIJxtC0Y0YE\nMqZQqLfeyUsjS9b+QFJlO9Rc6wO1PC9oqIsXcgpUIk+8FLJPuoQCXrjU2fsp\n1lBvFiFlk5V19qLjdDgxvcy0GPBRqaJU9ynaeCc8UsywvSxaiXaraxgtPKDp\nHAzE48Ra2hUQJfxBOyijYusf7hdIAWcnqz2ugeWEcWx3ViV8cDVNp3ToWFPK\n4tIKRZpu4ZTqtGug1HlZmLayotm6LFGSdMxf/BCKmfKoFtILkrOjGL/glTq0\ni1OWAAH8OATdZD5GeT16Dg3lUP8qnwloY6/FmVN21zrwReY+zBVvSdamUEsC\nmiyD\r\n=fMBI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b819942e913b703141154b98ad648faa4ff2abbf","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1406"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1406_1591566392815_0.7547006773966733","host":"s3://npm-registry-packages"}},"0.11.7-pre.1415":{"name":"piral-pwa","version":"0.11.7-pre.1415","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1415","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cf7d16c464a8f2073a697dbc329718dc98828534","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1415.tgz","fileCount":25,"integrity":"sha512-cwRH7uVtEw0zTqISNg4ISm1sQNS1cXPZuhS9O1Jy8/daqvyZ/kwRSQQ1Oh73H6YkxnYBHjRff6uZeEAMKxQY8A==","signatures":[{"sig":"MEYCIQDdie5ECi34US3awpI0tlovGcMZetgF8nSJyT/lQ2HF/QIhAIp071GEd97lAOImAZ7locGqce+N0kxPHOe8UNcPNrEu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4Ic7CRA9TVsSAnZWagAAFhwP/3Y6mWAHqYRllEaJOP7j\nCmBD84MXn46aNvp6mbbCG6bMWe7ue7Hdt8QujuzPbkFKdIws3LGmfeCP4d1B\nrD4bXo42+U2b1PpRATf8EYe2pzXgmwcOeeF+NcUQ0PJApBsl4vnLtUokAtb1\nCuQaGah1XqyrY5yjbJeOf5HY84c7R5C/dAQh/8sav1ra+YoqvobPusTk39Rt\nKAEq+l36AjJFb9rZZop3Slk826bL6yIHsJDQQD59BnQ2LUUC8llyK1Ue6jnw\nXN9tgiosc4bsQw2b66mzGmFt4hfb5ue2Uxl64xxuWW+iZPktj2t7rMCxOBtD\n7AKKXCfujXbXvK1Wr4ywpZGa8uhrXdyhTiMAXbZJEc/XlHans9dN//VgAro8\nHf67WRHDoQnsBzVWULZx7SAYwUW0aYhtNwrhVNFZDb7tZ1YinjYi0qg7jQHV\nmG9DozZlsRIWBj+OgyYm2LHQAYnFpZgE5MsiA4ggyOOBxuqbxmsYBREXEDfc\nWhY17gWs/hqFpBDGXfkGAIP1U8vBDyPqz5CoKLOjthez7mfItxPOCAMpXNa3\ne5waxIQiIloeQ3EgNQC3UyRdopwbjOXT3h3xyeBWa2GRzrI5mCgYsG0mz+n7\nmwItmUzlmyzBGHxRsS0xZMaVBiA0cYajPLJt2f0aHDvhD8SV5EnX3hvZaFtm\n15El\r\n=WoQF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d23364acb75206d6b542cd48026e377c4c34d59d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1415"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1415_1591772986755_0.3565676078424198","host":"s3://npm-registry-packages"}},"0.11.7-pre.1416":{"name":"piral-pwa","version":"0.11.7-pre.1416","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1416","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2328112f77f10e64eea82e7dd4c8755651a357ce","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1416.tgz","fileCount":25,"integrity":"sha512-8kVoGrQ3ie7ZvmJ3aC2NS6HLBXAeu5rV58vrY+/f2DgJ9iKbYZi68/BL+QvMxFJ6UPXyuGqay0IYy3HU+2QSbA==","signatures":[{"sig":"MEUCICW0Zau6NmQENnfuGUZdWieTfPeMJ5YpBBf0ZnEc+hllAiEA3vpZCHIFPKjzLOrWpxpfxC6p6lV74idCe2pvRKUT/Hc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4J8yCRA9TVsSAnZWagAAdgMP/0/PAdyX1iUQR9O7pKqj\nH1PkgcUhAk/V2bredLhKEIWFf3BEQ+nFpZ0wqbBOVdvqyn2vwojt/ySSj1fk\nmxRhrUn3x0HaD4ji44RSaoIS0PgltzBTRgdH4JABIaYGBMvbTPAPJBw8LgMS\niLp2VWLG6+g1kKmIUppzBk4MowZs6QoT3bSCzXh1nJ8TJvyQtN3//U+/iBOE\nKf2JBYfns2e791ckafp5Bf+yVXSNXIQivJJzAqMSyELydu15TjsaVBTVHUW1\nXJe4CDYtmeOnllDo0eSLm+/RuXCAXS12ANOHT57ZagxM0/X4kdBWHF4ylsQb\nbHxgyYx8xcTRCzHmsrErM7w0CjmuuFvpxKZlbqJT5hreYrFUnvUltw5DJ9Vg\nbl+BYx+i9uiQPxaV2Z+ilbW9D5huwjtQUZD2Cmeo8raNT9i/z0hnIVeFEz7J\nwzccHaow1+eYLvxiN9JMUdnVE286jKZLZ/9F3JoyhcVTPN73s1Scv2XUf6W7\nPaVkf+JGLM+m9KogMoUcqO655Glvmr5KPRXIRUUn/x0S67C4Tq8J0M2eZ36X\nfTV3TaIzmM0XVs8Tl+F08Th3nRdaKwKJIs4jvIh0vm5hf4yDEKZkVAtvCZQO\n0suFUzGtnEgXa2k6DwfzUs1QVRhPUKTmwlgLzkH4vv1VgRTOSZWUThdIoPRa\nYl1P\r\n=SRD1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8b42780c2a66b8a76acecc1cb61e072f49622de1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1416"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1416_1591779122482_0.41688217656094273","host":"s3://npm-registry-packages"}},"0.11.7-pre.1417":{"name":"piral-pwa","version":"0.11.7-pre.1417","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1417","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a3457dc0f82de957be5df12e59e3e74d05b65e3f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1417.tgz","fileCount":25,"integrity":"sha512-yQJYySnoj0D9d4kC1ePDZTNuTQowpGoxhlFRr80yUALap4OZMjAAW4+wnyI8E9sIUghn1WldKTzWqHy6NpoW0w==","signatures":[{"sig":"MEUCIGsRDwPZobgY0R1juNsuqcqUz92d3zRBgRgVwDRhqVUvAiEAoiWapwVNROjIkXK7G9+KUKoyPc9OUqMhl8uqKZ87Hkk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4KezCRA9TVsSAnZWagAAVgEQAIn4mH9r23Knc7qBEYAC\nqnxkFxjWRovt4xsZ5P7G919xW7YZEFkkzMTdJ3/U7TiwRkPxScapCLvJs0fY\nGfj9sQbEVdaCf25fAp9gOSyr4Qj2oYVnLj0d0siImpJTYzrhCVjcd2QvX3aR\nRUaROb0+H6Rw6PmJ4NEtDYNBfZdqfMhmYIs0P9vlHO28BroV7oYrw1WUC7wH\nSzsdHRaQRUp8MnK7qvNEMRpLt+/cfL8oTmMeNAJ0HGbfKHt5PTeFbBVNnwxH\na4lPNuw0rNWZiO3Sw/Dt0XiBmOxmYskRqxa86jHd037pBpfgFthbclsCExjT\npn8JXWJ7RXm83flKWUH5B/0xLtOfmEsedQdx4zkgOiGyX0g9nDrzqLYvEw8Y\naNAnrrJ5An3bos4pkDSkxPQRdpzHvGLBJ8T+xlstDEk5L+S+yg7heaul3Cwq\nGfA7tfTIj2GLYGlRHi+Q+xl69Y1v9ck+L6zAnjUrdO/iGj6i/AseFaR7Xy3n\ncdkOz0FtC5upN6o0oouW8+c4TVMRku0ZHKM8cf0cOcNdVKhbG1OQr+8qoF/g\n5pi5+bjJqfXoV9pLZZ+QZ7zY3tFd5uhOVU4d0Tz5XC5MtqwLrjmDIsrWis+A\n/kpp+Wh/5AG/T8oZDtOOJoQWa8fAl0xvi4q3VOs4CrU3b9+bfQL3IO6h6nk+\nyHDB\r\n=m3jq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"00199cfd5cdc12e23b981bf3b3849ceb4990005c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1417"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1417_1591781298680_0.34910176175044794","host":"s3://npm-registry-packages"}},"0.11.7-pre.1420":{"name":"piral-pwa","version":"0.11.7-pre.1420","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1420","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"efbd8bc7c689c3526d45ccb3dddb109533f21daf","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1420.tgz","fileCount":25,"integrity":"sha512-gviiG+oBN44gMwfiEknEuC1HCDaBNzGW5wvmQ2hfEq9tnmurvsNcYmVhiafHhIJ5Vy9blRcHhfWwGoPQ8rBJgw==","signatures":[{"sig":"MEQCIBubsAcz0/esUasMOnlXV2qTbiZqTU0AZoHrLIEyZWUIAiBjFNCSiGHJ4C4eF6YlPmZl3JMojVciyu0HIjs/gRIKbA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4M8oCRA9TVsSAnZWagAA40YP/RDW99Oi8CQb20dQhnZM\nz3QjvMqQxGrf73O3BYvnAhjm6QwZ1Py5OlmJDxcVZyYDBVSFYpBS0F4HnNYR\nXw8mho7y/UIrJFBTgVD2+HI2zlDa5jsPsDxgl4QPXRIwHJP+dXa5cHlCnkvD\nCASPcXx7J77S0iOv3/OxVXwDJytJiuRQ2elaovP2zKTnDDIQZLGIwGCKYEy8\nl3oAyIDNAmnsvQcU8/tuiOGu+6TSMYxjzp752SWCgrzrh1Y2QWLumh6SPse1\n824u1b04LBppbTOzMsSAnjqwa3USvkx2vlAnsVJWRJ+IxwnLVrrvve84LZ+X\n09OISUQKcI5naGPw3bCMZhjxLQeuU4cDBAMeS974oQOcVlpP5HzLz15av3Bu\n8JIY3QQQ8ICMGxMxRQRMST9yJrC62xKDco4t+XLU3PfN4W7fbIvx7id4IKiF\nqagQPnvDx2gV7R30PV+xu57t/3mn3+YlmWm666OUlh1tjCd4ZYWywkcGgLfO\n21vEiRnOT2bSNoeRYDkeAwSleiv8M7NTtt/2twkA9KvXDdCE4PN4pfNtkVaS\nA7/c631rcm009DcpljfDENWdW+xCpOB1lHvOjmRES84o9RQal4ozTmFz8B8h\nw940p16bMlxgKMYI5e3ukMD2kADOtLAJjPjFnxKJG0nZquhpUhrKgJvxJjrq\nkZHq\r\n=tJBK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8e7837ab12a56161240940e5b746d6625a826ff5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1420"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1420_1591791400406_0.5245364756910529","host":"s3://npm-registry-packages"}},"0.11.7-pre.1421":{"name":"piral-pwa","version":"0.11.7-pre.1421","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1421","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4df99e7ad7c050fe1a84d3efcbc70ba2167d78fa","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1421.tgz","fileCount":25,"integrity":"sha512-mMizsKRWRCoPpy53YmjVT7UENkFmFfnXMSu1OHoDtjofxKeuBGpETHwpHNi/UNH63FnKHx77xPIK6TcRU+UF1g==","signatures":[{"sig":"MEUCICf6c9VUQ02+dVoKqXWkJTZnTsqBFxeI/EJ4sZ+k0xihAiEA984LBSIQOTjpOOZO6h8NEr+RN9zjuW2P/bKb9SHlTmo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4QChCRA9TVsSAnZWagAADxUP/0x73INxJfdsAi3Vt2Nt\n7FJoFGzH5xEsOgrGFwVlMNklv9pe+8D6CNCg4ybIwajuCCCHFif9aZdpX85t\noLyBGclGur+p0XVCObU/tI76TaQQ1ERqtCSC+QVpVkdGLTCO06paU4aBNuXr\n2bc4ImO21sUytFeUEB9P/UKi0xDJwH6o3FWD4xmPG9PxIXheD+1JhViVuAju\nB+IMPHGULbYCdvCJYdGOMbWTJYKXq8i7WeC/oI0h5UmsEuGVPLolPT3oKjK3\nIQ8ovTlnPa1rm5xk6v0F9kyoTKuihzAlEVVnuLE13vLGAZJLtqIMQf84heZ3\nt/C30GNE1bGfPu+0ctWJxjHAY3kVoP4PR/keqDTyvnoSngjmsToDHdjRNyyG\nGcmc8f+hZe5beFNAUqrMx4yRsHJ7cfcSfwh8JC5007GnwGfI/mxq7a4f9gJz\nhcpotUOj2mFWl18VCR3qXaYQ1mMq2iAxp/kAfUbKk3b9ga15vWrBawJDJZ+s\nTyuyOVTfDHhZ44wrb+DPyj6iljsFJgkP6doGBM1KCF0uGGCP9TYOhOhtPMBw\nbB2xSFDEJFIG3Gcbz/iADvWWRkjkHN44JV0vdx+okl1GXWwRHLs98IbQADZ/\nfMxyYIYVcJVlo+VIyfV8EyUOsjXcHa9j+rzbxdcIzQkQoahJVUUYKDxrHZ8b\nkocf\r\n=CC5l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f6cb7c22c8a663f0c6ebc8c6ab05f852a6748b9b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1421"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1421_1591804065434_0.9140944532761162","host":"s3://npm-registry-packages"}},"0.11.7-pre.1423":{"name":"piral-pwa","version":"0.11.7-pre.1423","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1423","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a7f0e2017eb67511db113ff6e41bcd3f02217cbf","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1423.tgz","fileCount":25,"integrity":"sha512-pFfoGvKnQuwOeKmNh22eTXAdWNDZI8XbxW7dP+H698Qzp4mrBjBAeTBmA+eCxEKIhek/f02W01kVo5Pmp7gL3Q==","signatures":[{"sig":"MEUCIQCcdMWPjnNfEhdv16ihJcGRIwz9m1ey3Em+q/FnsOe5gwIgBijIfgmaHFuUCcPqtevB4Z2gqqm5YSmCy9p6e3rrcNs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4yxDCRA9TVsSAnZWagAAZtUQAIj5XuiTSOSsFjl3nPTg\nAVpRfnZhzyUIUnbAl6v6zVxUr+fyIV0PsdSvoYikzPuqvLJdjDx0SqNaqGsD\nfvg6JiTz9GjoXPkGWUY0KxP+MFn8pmgljlNTwYQ6woAYK8ScxubSg1mm9m9X\nns4mEki6DXydEGTU5WsKCasK8thFC+FObjU4vyhVY/VtQlMsUvBa3xqYypiz\nD5y4pwTxvVQLhCyxEQD4SOggthM+mOWjAcNgr4h9ppgjdbtcXc4zYez5tddN\nA6ze/KUO/AS4qK1UTXwR08klPirBICZ/QyeGscAnl8nKEqxvbTM1xZMr4gOa\n7qiaWyoWwA+1ilqsY6M0nGdMPpzCKPfngt0J9Xdc5N8LWAvCUGd/fBawGREX\nx1F4rxTfUxotEyu/MiRgyNr1kt5GZX6LZUdrAhKgDkeNpa1/dv50kJGjFmkP\n/NK/7wRLO0CogD20ZKrc2zSJOCA8RiZZ2UY5C1Fboe8TUVsgOy7ofgtOZfFi\n2m/wXt5WfAhENCCFVN5jm2IDvuSotXJU/0SWRF/2NXKs+LZiAZByciYMSdq8\n0Z7wMd6zqWY26KWdEDRTUbuTGkhOpwYDKbIZLNRR6ck1mkDV+qiZpqVMrzUd\nSgVXvDqz+hMOM0mEE+cp5rN3e0VP4RVIG03jhd0z75O4wWDuMF6gCd9UaGEB\nQVIB\r\n=716x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f0e7891a9e260c6d99e1b0418f2f877b98d7125b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1423"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1423_1591946307128_0.559728187401852","host":"s3://npm-registry-packages"}},"0.11.7-pre.1424":{"name":"piral-pwa","version":"0.11.7-pre.1424","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1424","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4ee72d0425030bb0bbbad0850416bc5c5faa8c59","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1424.tgz","fileCount":25,"integrity":"sha512-eNyi4jSS1wXO2BYPqmkFqiPWdH805HnhP2zbEg+9BrVeDCIzMwklu1IsJKsu4l48DgiFAsdELUS44OlaAAxdSQ==","signatures":[{"sig":"MEYCIQCakLu9bXBkzDKylCnW2nyhzhbJSHBpvAuPeGqVr4YbugIhAMosy87DPqUEW9IuYqT9LWZCPUNNfprfywPm0ifZaGKA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe5paHCRA9TVsSAnZWagAAu94QAIaLjAOtgkpWWCjpMCeF\ncaGWeb5Y+YIDQILjBmEuBB23IXLDAGH+/6aeA2P0V7USVoF0pr2GT7kl+TGL\nt3Bkj4HO387UMhESSFX5DpuRa8F0n/wijNwuoI/FzFWyM2/+wh4cg+mKKzyr\n/BnwvkDeM0DW7XJUi7hEZOui5q8D4aYSKwtFvpBpGKT6doPD3k/rmS9513oc\nB1kIyuiIA54uh8Xk8BNdF1whXp6KWv4OYS9rZD2GuJODEHIRoOmBMFTDOYGR\nqiXQeSyyJGPkR4LjI6Nnxp3x6vsFlPjaZgYgiJsqR9EE9w43+Gf4yoe4FS9O\nJkKakDeEbFoJ0RRpJjy8JluB6bn1sd6hUIQPLQAxxE+ruYWalsUf5UcGdNy0\nBjs75aYxfz5upFYJpNVspcp4seQaG8RMAgioXksBEVK1njPqaaNyRjcqT/r6\nbUTtsyBWn/rEtaUQnggRLdpn5aMZENosM8AevqObBQh+xBDet+/tFORXkIWH\nOZ8V/20UtM13fed/SvqRtT/LCR6kmBr3qurJHvuOh1OYeNjr7VtvleVHBqDP\n90pDJ7g1YI12OlA7LhwcGavaDCu+4pQnWRaKhmh2lDszoE2cNHQCTxtass3W\npqpfsCn2pJT43I8/86OCn+O0l555RDY8X70o0cOy3AT/WBZ/MRzWQyh95bNw\n8Eu+\r\n=nYgD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9c69064a69e8e7faf332a8ab069be006afeb9274","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1424"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1424_1592170118609_0.20217617505371988","host":"s3://npm-registry-packages"}},"0.11.7-pre.1425":{"name":"piral-pwa","version":"0.11.7-pre.1425","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1425","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0a38a5cc0c2ca2f593aec171fe87cdb28737e91b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1425.tgz","fileCount":25,"integrity":"sha512-EpHx4nIGc7hg8t5n+oYWgnxFp7Ogzfb+DiKgPAs/0yS/ZPbyK88DlfQrMXrzvsgzCfHbiQAXXEHaf9LsHhvCtw==","signatures":[{"sig":"MEQCHxxbGh3VWoWKBCf4N7WpErZKNPV5L/aW7HEDfCqT6gMCIQDvkO+Q4P3joWiqv2V2tho9rUKxq2njC4t/XH/VrotZKg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe52j4CRA9TVsSAnZWagAA1VAP/04sPzcY0zNlTcxvPxUm\nOEUYeDj7lJ89mbKx5/58OLqwqSvEDKrVV/gKlik4ytIWMfBSwcOaGFlVXY1b\nxgy/2fdMwbiHCI8mZznA701ZkXUYwngZI2GK8wPQuELn6VywDFNhGlv2dsmH\ncTPKhjhtRpMxCtHhu8/PuxIkTYBUSiOVwySOQhnf2Iqbdt6vQHY4PXEv9D7d\nGZbFl5csA7qR4Z4WRA0TYUWm6I5kCFYPReGU4oBwWZNlit9uWOLpIR2S+rKF\n60oTZhSEX6eT4cXuEAPl5RdDE/nrDzRCwEvNdorxlOyL3/UL2fE/+PxeOXst\nFBZRoXQsuWwRNI6gvBXwlYAo6bQ0Kd/hi/Rrs4YoBrkCoshUU2b46I2I/fBk\nwzOHBPIWT0sud6tjSe7U39r7x4JmuRHdMq84Td4N9l9o9MWZ5cOacNxaTTKM\nfXvyGn4i/HxYc787BnlZ2xOWIL3TkIRRxUOqshA9mm7I64neKBLXSAYFjQ4f\n43SvhTxvLPYkk28+0CfMMGYGZBck/oroXsFrJH0QvvkQa/M5me8u0EFk/pcn\nX1t1jxHx3jFlY+aGsnfTfIwY4wWRU1TWkzUk/WPlc9hb2jVnIHPHIM6YEjld\nrrJxEyyWi2x2f0ZRFJvi8kGwKSJfXubdfqpI6cEKBPo7CFSMEI8DgAcAImVS\n9d6M\r\n=kUwe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1289a0e81dbd2bf9034e53d74a992e488b409a6d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1425"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1425_1592223991779_0.39374202303584505","host":"s3://npm-registry-packages"}},"0.11.7-pre.1426":{"name":"piral-pwa","version":"0.11.7-pre.1426","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1426","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"594f94a82ecd4084cda268417f1cbe3bebe2f169","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1426.tgz","fileCount":25,"integrity":"sha512-R/TFjrx89i+uldfdzmKFpYFxgfUHjn+ePfQIicFM6Zk7gvhCojVQcEPyoRP08JS7ssonOrNviPg+M7Ltu1mi3g==","signatures":[{"sig":"MEQCIFBEwkUrFKSmSmeehAEhidTVYsQ72p3EQD6mkUxjzpamAiBPHaY6T2CA4sTTy+mj/MPZ70EXlWStrOEN1o7QhbPEAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6AOWCRA9TVsSAnZWagAAaCEQAJYze3GJU4/oi+w7hha7\nhOLAcBNEKK1aT5g11U5KutAvyl9ZuTo3Y8bQmHEiM1Qls0BjDZSp6Nii2Vts\n0AJxIRTni1RdWJb/tTURPQx9Ma53Cd/oKCH/I4THjSGgAEQ4LLx5k0PjNuKf\nljpHmbReRjNXsU0o3R9Unab+snmFASzrfe1/h6daFu5oA+l8+ucZLsdCLhYK\n86yw3jZz/PwYC4zSQF2SRtwP5OGRQblSkqqCqvZ1w/5q2AlZCc74YzScIceM\nYjPGQz9vcwqRx3ulbY5yRLtjWtBu0to3m4JSsrDiaeq4f9UU+voBV8MfLSba\nbMriNOrdnNQU979hASjQJ9Qv0noWLfFJ7XlLmPgd+HCaHuiJPrhXCLjabnlU\nsLztpkBzfDYFJV/3hsuICdJL25xGoXeB87FTf6kSqbfAVul/EvEirluDzWxW\neNlTQ8TcREun9CNfwQ09fB3KMnQVQxZ7RUQzx/C5Fv9uHoPSUJWbSL7oKGS+\nQbS7YXdjKfaleir52MryqY6kdcGg3rfBJ9ZthrlEr3VuB88jvMVH240AvIDr\n+mp39xqq5sOHhE42XaJL7HJ1oCOQ1Rv43er4v5UjNnXDlH2R2Og6I6p56JQ8\n2x8Fj2fw4phGawnGvQxUQfLIpgTHcb5MA5VtjrOZWuDpZWnaSfBL1raXUNYR\nQrzI\r\n=MRAQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1716378284edcaa468e24b8f88f5b91f6cee4121","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1426"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1426_1592263573917_0.11735109812530475","host":"s3://npm-registry-packages"}},"0.11.7-pre.1427":{"name":"piral-pwa","version":"0.11.7-pre.1427","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1427","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8de707c7558bbbd972c5777a02303b6fda23d6d4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1427.tgz","fileCount":25,"integrity":"sha512-gKlj286lZPHKdnBGjYXFfl5iAKWJgx/RoFV5Fj6D1oylJDC3Td212VaSJv8paioIIbSeL3rlmma1MhLmj9HFMg==","signatures":[{"sig":"MEQCIBoSNRuoES06g1LSeb/WPTQsFnG2QO21yIFM/oUg+9YIAiBOEpUms+bmNjZ270EM3w78SVWMNTaKlvxMK2lAjBcYRg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6JqyCRA9TVsSAnZWagAAn1sP/iKQ0/W7N6R/foykCPfa\nBFDl/4aXGZJ1GKlusCbhrkM7cI1Oo9yYQ2H2uix9PaLJXtshaDlfx6KVkZWc\n/rXRYDEA8nybI9lv/gKXsmFl6nI3pNREwm4j3pGb9NWX88Q405HtZHqHEDIN\nfU33gC/iFRTRjddaWSj3zFl27+RnFhrVFDi4YImwCwqgFfOLe1ijKAcULgDX\nUo8Mrytertz4vZuqH/IWrfL+fqcMBBL5FIpz8mcDKH5oeW8hNVUuJx1HKCcR\nM5E/6b1jqC5SD35elN8G5zRWb9rPnmZ2bTr7HNs/agW2E+ninK/oul7YKozz\noO0kIqJescrasB8IQIrxJcoGPudKL++48swcwUfb8tO26TlLENsoJSCuEGCn\ncAYzgWIIbEMC3kslnlzYucnSGEGedqfVjpbDB22N3cQ2P+Cg1LEkP9ZX/H+S\n/FYrf+5hDlwXwlcwKywUDdeiNFMJYSShHZYEqi8ZESWY/26HtuN9nRntuUZn\nhukFFj9EYqGres4wmb7nO5PsRbi9eK81zzV3qiML+ZWaf3lMaYV3ZuHPPu4C\ntl5y8rnCvp6U685C3fF1CdKK0s2178VbiaNiU/9xIed3gAXr67v66G1QuMdq\nugUpv/EMp2U6TI8BGTfgsTLSHLlrRmdLh5oO93MAbMu/y+xFdCFCBoR+hhGS\nas60\r\n=hwUz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"55cad63de2a3d100b5594513c8c3e3a6e15f6a00","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.18.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1427"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1427_1592302257621_0.5377359579601015","host":"s3://npm-registry-packages"}},"0.11.7-pre.1428":{"name":"piral-pwa","version":"0.11.7-pre.1428","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1428","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1c2fc4588001bfa0050dc0eb9a676c687114603c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1428.tgz","fileCount":25,"integrity":"sha512-6hW0XEFe/ND8jQVoay2RWHAj7h42nz7hfeDNzJPcN+Tg50PyaHXOF1cwFenhj99HTvyNkNFKfUoZ06W6x3A/0w==","signatures":[{"sig":"MEYCIQCyEDAtnvA1+SihdawO00w5SivAtXrHkDezcggcaLEQIAIhAL2nSTLz2Qp7nn1fGjlleRbRa7JHUbgXm2wve/9ozBl9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6NjfCRA9TVsSAnZWagAAZ80P/1gebLtRB3mxTwOA1Ii5\nkyAxZHH7sc2csKsQ6JwindaaR+8YbTj8lyO9Vp6EGk/Tfy6OYVFmvLkVBh39\nvZ8dROxfWop4/+NokldZwr61s8sZDQ+A0mNIEznj0ihiKxjuelYL/k2XRecw\nzhgkNJqE2fyD8qdfrNx9t/T1sYjWDXWeB1gfZkTfgS9r2iQO0/vV88H8F6BE\n2nGl8HUcDzJiLAyYmRvpjIbDfoYB0OVuRWkRtdUFmWeB6B2UlNZ3LniW1g75\nW5159RLJ5Z6/tvQGJXztuIP4M6pZr+ZWw04CzAJDOo4qDF6m42bXGRfwdRJ2\nNRMRJ4459fKwPrdb+xPoggqN6PodJ5/t6CpV8J9Xzcn9bdQT//YCJ+DhW5jj\n2XrQHwz2bW0Xzx05jeeT/NWUO/RXUwH/pDRuZvE+XJb5+J/ByMiU8Jtzr9zJ\nVwxNsk0AhgLDeivC+xEeIgXnP85i9ZXERhSIugaRLDm3Dr2W0VVMMJ1mbbZy\nK/2bpnBguZJkTDlsQUurcxgonRg5QHoiGBejn42ZNCNKS+KaB6Yuoiea1hj/\nqwIkMmWfjlARWOSZDbzojwrW6hgH7aHVHjcPFeKdsy+r2sjryN/WKUpdrMtO\nWb/R2kQ9RtUKUJRtpWZL7iGd1SL/k6vQGs9bNvdFCFhkRfoUTomU9bH0aOJF\nX0vx\r\n=Eb8p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"55cad63de2a3d100b5594513c8c3e3a6e15f6a00","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1428"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1428_1592318175129_0.4654192372113062","host":"s3://npm-registry-packages"}},"0.11.7-pre.1429":{"name":"piral-pwa","version":"0.11.7-pre.1429","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1429","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"27230a6e90fb66919b118fe4283c7b4af670d100","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1429.tgz","fileCount":25,"integrity":"sha512-Z99obJR3LpM8gAN2Xvz2yk87HaU/XSXU3JWAF4K+8QR6kPKBTC0AA/e11CsP3uzlNAGEu9QTXLcBsPFmtEq5OA==","signatures":[{"sig":"MEUCIGTjbxUg8zl9YufxisHWjRD1VDume1l6EXPrc8kedN5nAiEAhe5JdhMFYVIkNd4jbR4Dojj0R7Gg2tMyaLoBHYn3M1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6S4FCRA9TVsSAnZWagAAn68P/0fgkcv1n0p6DZgGteDg\nIlw0lcTvrVIOskvjrInt4U+b/mc12bRb4T2Bx390XZDjYzTL+sARvJ/paiFh\nGQTtxat8Q8QLwxe8+T2HcQYkTdUGxqeClJIy33VcH1qrVWmgJyeaTWKTZupl\n7VU3sUHIVInDITyesaD43eWXPLGORyfmKAV/v8smhxZDSR4GoHBp8MbB+682\nW2NjTFQGlx9a56rTw3zDAlWdXdJFoGiQS9DsVka+LwvtWbBKMJ3y2faTJj8E\nTwiL7V8XxyZa2FejUReTteqbRZNhTSZ6Xol9+cRR/CxcXOc3bsUS84lk6G55\nbcmjmS3RIsQOga0p+vl0Y+K8eZB72IlJI2g+BJSLP68HB84gDCFk73VDK4Ey\nH9QiVpedBDIw+XwSNOfrCk6V1et4dw6T3KaNFfrqH7O5/wd976klhBENCH+2\nlUW937jx7odpNFlpdY0PO8K/Rigv1Xy73ME2YBOYIQ3u5ECGB+2Mpe28mXrB\nknZt1YvFtEdMZF0nymdxfYSlTvdrtu6hbMP66/BeHDWhaUfvwfshDgPBaKoM\nXl2FRZE++55PAgs17sUE3n2pWif8TFWhLT0kQlNlEUfOG0q9P7lacD4qrpzO\nruEjcul/GuW2lpPfqRtUW7qWKOi2PRycikRnuO0JZQzo44eHnSwgcFDN9FJo\nNyx3\r\n=dKBH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a90898fa14de3452eafbb4642df2ab3bbb49a7d3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1429"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1429_1592339973204_0.8019805165477312","host":"s3://npm-registry-packages"}},"0.11.7-pre.1430":{"name":"piral-pwa","version":"0.11.7-pre.1430","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1430","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7f459552bd1b0f87a4d3e0009c1d1861af8f0d0b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1430.tgz","fileCount":25,"integrity":"sha512-gB8xzTb7SGQ6oTmw3UwAox5Z0Yx1Om//GwhlkHJNId1AaWChVPw7T5+6b6G0pUkM1e/dBMbTLcqkpUYifxwJOw==","signatures":[{"sig":"MEUCIDyll6xs/ez9f1JfP2LR++M2w1r0kIcmv7CuhNubjalUAiEA34MtYweCo+Ijncc1itMRyVFWl5HpKVeIDgYiLqeneu8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6q1PCRA9TVsSAnZWagAAp8oP/iLAspVRVRTiieZDf6Op\nNL9skBVXA1Lj+1+spdtjVKczRiR1gGw9MuUCrKliHdRzBNCtJZpjwUjVvlsd\nGwdRcB9JV6p+nLTD1lTAo9kDv8CemCJUGPvNIwpF9XS8nAIqRPWMkrOsL4U3\nvwOuSlMMabeN7bD3De3IJItj31MCf5n827JAh4LBCcoFX62eYJNeGgBN1XS9\n1/c7MhBtjKOXC56TOWgu1E7bk4JW0Y/3LfLF8IBCyrJVc62tKfLSqGP/3fGs\nrGgFATYIIyYrdEQ7leIoLAfAXkHGpYqVL+oeGNPKjja6mXGikYwCk6qLwUgQ\nUfPcbqJbpMI8MF4w4UbEvJbeuBb19df+D8Vg4FIusUeOb+mhWsuK87LspTlC\nFtlSXjOU0Yv3wlVtQy8DP1YxYypvfqljW3y6RVIe9gsBvsZvL4Jy/2L12Mng\nsZmZSlQCyb8KgMORxAlzzyQvWUvFoasJgDQg5+iGPwylZVLUQHNNR9xwjobz\n6UmoPGdNux1MQRqjqqM/Q++QaNe22/qaA3DMgyysQS/1vvEfZw7krKHsZZFl\n68Rhqj2/OaTzCWP47gsEVsN6XvteNiMCNtECzzXZOkA4wlBCQECq1lJSHdn/\nTn8/PkqHdd835iGsaFIi/RA/TweIJgnmvdn96c1GiWycGFog/X4Qu2U4G6Ww\nlJ60\r\n=/u4s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"dedb7a52ca53e7fb8ef62b6093379229bf2f6c5f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1430"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1430_1592438095236_0.6271563488577692","host":"s3://npm-registry-packages"}},"0.11.7-pre.1431":{"name":"piral-pwa","version":"0.11.7-pre.1431","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1431","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2b93a4bd57b10647fdf56807f3d4dad9865b219a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1431.tgz","fileCount":25,"integrity":"sha512-Vs7U1oj1Y0J1ZcxIcNshGg13HyPMbLNBLYgy3ig3bZGpHs9LBMAstOaw2CgjzxwfynuF45WaBelj+HnVkGWD3w==","signatures":[{"sig":"MEQCIGyaJp5TE77ibUWxwJKK1ZGOut5nQ7GIO664Z8Sx/Sf9AiBa78IoLmkHkZ2UKnhBPIjG9y5Qu0S2G+/WkHkJ4PeDHQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6w11CRA9TVsSAnZWagAAwyoP/izNIyQauYjbR3AlHERZ\nh/ju01JF6iGz49InNpfP2z4/zccNs1at/AZy5d2kYDu6SqskNcQHuqCNMMb7\no1TGrLHTzQJlPY+J5/ey6wl5jmHOeYb4PpMymTSnlxaEdrrxnI8t6ehG8Gan\nX+/JOvQVpPzIw6fhK1Z5QwmJiIO/7NLuJcQ3MN8V6K6GFeo91XuGh+/lDr07\nxsqwgdhd/caLG1ZfKyxy5g4WkVtFqs4Mhiyt6C2QgE0vIARFYUo2QmYOtz6w\n0GVQSZbwuBN1/qsFTFKm3Gwua1YcdaD1oavZCjgQkm3i21S3MiuOiG4q+qIQ\nS+Vyg8gQijVbuKRlJfcNw8UNsUMcLr+vkf3IkFvMlbRXVTK5Dzp1dy+wu+1k\nD+DUPhncTLJOn/pUCkYmUBGw/MRhW6ox+vYZ0BpDClKxwQMSncnHOV9j0StG\nw/DTwMlPBx/n8XDm4l2J7TaoPX5Cf6Mz4UIAJAcOi/8ast+nSEb/c5gejgKz\nx2USjMWsODxp0pwL1NLWXTcVMYr8+gBijaCpioQP48vjmHj06Ru4dE2jEN9V\nqss9goPQSe97AN5e59OZ+sIP/gLW7avKtZsqHK7Ftgeti2Vdlpt8mZgJKMWR\nTTVc7tqGdz5kT8iNDmHmsrwgByFNRQVGkWZ3j0GgBZ7ZXZpLXaNzItv3hs9R\nSSR9\r\n=+EH3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"808520d8a271ccf48d0d30c390ec1b678506a92f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1431"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1431_1592462709495_0.9980527505583745","host":"s3://npm-registry-packages"}},"0.11.7-pre.1433":{"name":"piral-pwa","version":"0.11.7-pre.1433","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1433","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"140491bf54fa1309ba6a0316972b217430e0af22","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1433.tgz","fileCount":25,"integrity":"sha512-RGcw0X50gAH1yYY2cbt5H9AILt2qtSCPcLfADJ42bWMFxKBVaJz6NVgpt2oRMoh/7Iv3D3ipS/n1jW+NlTHniw==","signatures":[{"sig":"MEUCIQCT7PooHZC0DhztlQHoo7sUho8zhNGutbqqMzaSUTe5vQIgAPARPX9u34oYN7b+7K/N8gzUzfWjfXK+4DVffDnjacU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7CixCRA9TVsSAnZWagAAupQP/jlG3Yh/slVblcqETUtl\nyNkxjsnFIyLMmJ5pQLhQplsJFu9b7bX+YBc+bVhuO0O/YfdKBquAhkjMitMG\nCS9rnBzr1bZCTMeTafrP1CIS2WqkAvlwNuUJDZErG6zeW3+ZzqBS9xXi23oE\n8A0bt+IoSrkFt+42l8ohZDK6DvVfOawjPXTfK9kAHgv5ZEyJpYN6GiJXFpru\n4AkLsiqPry4klSHQGYOEEo8B2yYJmb8OP1Ylfxwvdjx3W0RG3i/bRerX5vWe\nVBd0jp+sLl2GFxMALXUR+iRH7BYb3L2UyVg2IeqpxVPT7nLzTJV8qlI1YoyB\n46qqypBPPOkVTVcFFQuifCKWO0cXtwXR5631ArWsdnJlxIY42wMlw7mf4VVY\nVRxy8r++D/PLiPBkm8m0ewBSx/M8kQF/u7Nzeof52Qdmnt2RO29B9rkzAj4D\nnnWZkDHQfudvBfv2Vnrsj+fvzTM1iCE2fF34RV5kubuXAH7UB1FLXoxkAUfk\nk9p22/Xt9Zp6yONgZFxxy3m6ktupbD35SpWrHrK+zbED4N54k1f+FuUEE3gM\nADquJoRSvIE1pnBzY8EJsUdhnvP8kVPALfa2Fb7GtIRbGvCLhjNwE8toQAyx\n1WqMobl9wobT1e5fL2vgVgBkQ4q+/hHbgaRUp25R4WxgVToYE5+7eTGxx7uw\ne107\r\n=0uaZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"98e8cc1dc1e2680a7798154f033e99bce9222e0a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1433"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1433_1592535217372_0.8107601072401602","host":"s3://npm-registry-packages"}},"0.11.7-pre.1435":{"name":"piral-pwa","version":"0.11.7-pre.1435","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1435","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"beb7a4da48547837e4a431e25bab668274262994","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1435.tgz","fileCount":25,"integrity":"sha512-O1BQzHSWHjOHa2Y5gv4/ETvtL+780A+8IOeZgj9iNXCYxoOXXHmYwNrnLi5fTegRhbs17HiME5lliWJsHSF3xw==","signatures":[{"sig":"MEUCIQD7kq0YR+n+mtcAiAtaJc5TN+7T08/VNssMUKQgZoKl/gIgHUqqucVkLNdGjROINqbNLQs2MjZt6vYA2GicmZPXzq8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7pdDCRA9TVsSAnZWagAAOmcP/16oXyyjsRUzYtF2i2Oj\nd1csPejgwP6xz3uToDGSXviOddCyZLDHckeOp38yHTlvKive/FZ7Mj58ee+f\nEjGnwYqdLCYrXvQAUu+VcFSj6vXbrPzqxNZSHA7XpDNS6wqaXPFOxCGeDjn4\n1Aagi3BySPAsxo6yRkz1Nrvkz8NLv8eHvpumCPHmILVflBtD8tMddD2U3Qwu\n+K+fs2s9jttJPWXYAR8FZlk10EBxCJ7tBylOF2iYieUhxLAXpHuh9sPn3hFS\nW7r1VdN6XV5gSYrAlaUNM0dHaTyV6EAWBzZEKoB+Y48fTBXJopfTq96dbi/D\nAyqfpU230UzC7KtoYO2zp/hqw7rwUoJwEvVz8Qu86gUvyu+AJ3DmVtNDn1LQ\nNJYwEHntUI6Us41qehQ8SKKiq/+ErBXPaBNFRpvrmxR66J8o4T4oXvaYNr5l\nIkRmIkIRQtd9nQ1AMTXXDlCCa7fopiq4zF/R918lYNZ1funRGlFg6Ko1U1Yh\nLNIQeB4HZZHieAitSyv758gXQxYOsbkjZnnkjRRsizvvh+EndXwg+WCVxGws\n4K4sbXxNBoNa5DcOpyNJ/r8yAhH+bXnDnKA/K7b6KtRuJKeMGgSeTOiJmm2P\ndyDFp1D3ORSpk9mAZn7HXp+JVJ68wWw4oqPFgMxtgnr5jc/9PU0Thy2QeYfA\nmvkA\r\n=N3fJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"81ac39400bdd054cd87de9b33754a74420deeaca","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1435"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1435_1592694595140_0.25440093543075326","host":"s3://npm-registry-packages"}},"0.11.7-pre.1437":{"name":"piral-pwa","version":"0.11.7-pre.1437","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1437","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bed5a969175a557678d9dd46506597c2982cd022","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1437.tgz","fileCount":25,"integrity":"sha512-5WjxJmtYctwyB6R6GrhXvkt9PO7eCYhm/f8ta+Vc0KOU/5XCD8YRYhri4us88D9kvGnHy+D47PCajBt5TKVNfw==","signatures":[{"sig":"MEUCIDVWmduKjZs8qvfxDEMpx28PDJpcIEVERFi1XyWjCjIjAiEAwNozihWJo5ndg/4MwnxOqP6knJBoiv6rxyV0H+ex7kk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7qxHCRA9TVsSAnZWagAA3GoP/0rzW+azUoe0++QqTKIV\nrCMhazOOWGmIG3kfzHV3KISZxZd4VDaAb2JtPoqjksYxKTZvgTpEqd+gRa/Y\nwPpCUd46+RtmjID+zEK7U4C+YnmDSxa/x3an0UM0UTrULJ8bnpgGAy5ASkVE\nY8PgNfBdLzgqolsTvdiOjCk5glovNn6K1unxPmUnxtI8uWbPBPFkXhAt8hZY\ng9emmA2fvoD2sb5E3Kb3OmCeb22RfOGr9EJaI2dvSrDugKob4+XZwdYy7MYm\neVFsbRJ6IvtSvlfJrX2ptSkKWgra3eIbmUOqi2K4+03AhxF/IVQV0cjtqSYD\nsvqKS2GlkVKE0QWXIk/fxEv64vbtpzjCuQhl1XoeVBAbU0mtLtDQmIjNy4Ex\nrM9xLRfs9WLF+T7vYjra8e6TDh7+l+2bLbw/cYrOkDLPk4CyFEuk/p48GsLy\nHSIot6FII3ysXNK8OtRz7g1GAYw0SG+xLxqqWF8Hi4k3avyOFBkP4iEL4Rup\nl5I+wd4rtwfad3BnTiXjyvlrsc2h+w0FAwTzHTeP0d+gh9Zp0iZaIdPBVQFl\n/bI+PXdbXMHfEKxVdO1A77gYMtiMiAmrfrthpKchR8aS/rcsvGhWAIcWvpIt\nv7x7HqWGuy23zyjkCxhYrSbTo5PPJCFBy1S+BmeRVZdofpDkKYZlDjOv969C\nVhN7\r\n=Mw21\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7b749bd6b074f1d01bc765dffcf8df521b4e5921","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1437"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1437_1592699974609_0.9494809418806491","host":"s3://npm-registry-packages"}},"0.11.7-pre.1439":{"name":"piral-pwa","version":"0.11.7-pre.1439","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1439","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7f41c26329be95edc4bc33eb1056088ef41a9cd7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1439.tgz","fileCount":25,"integrity":"sha512-2inX0yNlYaUC+BFCiw6Sjp+8iZ+xQGBoOJHGQ0/uS/gNrNBZ6BfWBSKkvOhehcPpshlASxXRC7leM8ntgjc65g==","signatures":[{"sig":"MEUCIQDpSd2ltfRGBb+4G9WB0LDlsULb7orYpJMyDozf/RiPxgIgWcwY6xuVxP6mqzlc4aR1rN2xj1YF2ICCF1kUXhRqivY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe73UJCRA9TVsSAnZWagAAGL8QAKMLdeHHhZyjScCiPKpx\nZw7Z3gP1I6CAYNP2aad0oCvWUz6dwN5S5LqDTvwELqmx4JlocBeA7+XMnUwd\nZoTODot4M9klLEaz8Zwrc00XX6v9KhP2kOCTdjFx+jcJyxJ6OEYolSz3Ng+a\n8JRUNHgf0j9/rjaBM3c/3dAtY79aUG7xE+LyC+KV4iomEaMaltnmqM1pqXkb\n0Y0ve65NllJaI7qFmqOjIagMvIS7QDls1OSAal1eJt/2daZ6LnpsGvbYCJXP\nafcz3PAs6EJGZXOgKviH/l2AF6KTeunPjRUVhvPn2gjgAkAFF0rUPZ8tUx75\ndRF2FH1tVrsjESON0fF8IAjqhNSbfZLTbh61d8pnAT3tJ8xoG4997l0fXwV7\nvug6JaWeY/jqLhrDFtRl9KUfNA3jqw6/txcCXKwjCod/xy0NDhqfin1hzgj7\nTUMEkYomK9JLQGyyl/FT+KKu/t8ee0sY9XsTYO+/A5nzTXtV4LH0q91g5lul\n2NHaDcKpgnGFId6L4hnYBRK1kVoLx9aHjTTjEgZoV/lUtuow0MEFu4aBgSct\nCLUawnnDICopjNv6aTTvpgDFwa2vaE5hT7GaH5yFHwGhC9dmE3En/h+Q2aTN\n5526V18fiZ78ezXbRbAWNcqs+Wq4MfiNNmImSv4LWImX9zzXLZaeCWRjPqv0\nVkU0\r\n=dV5C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7eaa59e8d1420a4e02c93868d19b09a5486cb23f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1439"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1439_1592751369024_0.5597397631648404","host":"s3://npm-registry-packages"}},"0.11.7-pre.1441":{"name":"piral-pwa","version":"0.11.7-pre.1441","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7-pre.1441","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"077318bf95c389ad51b9943970f837c4e3016d9b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7-pre.1441.tgz","fileCount":25,"integrity":"sha512-M91vhYSJAGgv8R7Z3RZFWgLtGg9iFLFK4s1sW1i4xabqC6e6kRvNGa9z74INCRf9bF9gQ2U2Sd0yt0Xr8N40qg==","signatures":[{"sig":"MEUCIHAwSLp33G8ihEVqSyXC+SDr9f+tTxdiZPJT1PMWb/PkAiEAxC2lj5YT6X5Fq7OiNzONJvkXIxLjEw7LCF2uY8yWlik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8DqdCRA9TVsSAnZWagAAVVQP/3HdhulrlfUEWj6lBu7k\nWk7/bZdjtopauWYmyFu2AqHXnX860KrRweXvE1H940oX1Ef0Pcrqd8AF8cEF\nNtpLmBa7TLawBqNULHm3Skky9rXHpAOAgXmDEdku/NmfC6liXS69CyNSrlg5\nlqnFTY1Ry/QeJteLV6z7EmSuJZCRDTDINEADO2uyyLOHXGQR5AtATp1mAw18\nJfzVhQR0KwkMKtJoQdeJPS4ZKW3JWbv1F+6oIz5AwnAOh2UQbyMoR2ZxJjs+\ntOuGfhfusJ9K9Z4IWPBCOhEt75+qhGZTFpDLF8qnsFO/y96yJpYvUD8RovpW\ndpVGQVziDQPdaacGAZB9hd9mCbE3Qri5KLF6ItdxbnsDu0RXthzIFvGjHkG7\noaAteCoaUNrWa6/1Awd+EumVlC7hUocjqwfke+UY08pYsYY0B811S4bymwsl\nUegLmWe1/3i+fBE/OFdLWKj+swQiXOCnlLbfXEbEXswMBsHEMnzPG9aqjfLP\njVjwNyYq2jA2spViVpag+cJkU/woQqGA2Ko24itFvukpDS/bu+c9AvSkntwJ\nRtcJxxqQvBl4MNC967GHs01oeFvMmZI8feFPob0C3BqQNqQQs0vZFrcbD4Xn\niCd2lSpur0DZ+nIrgOrRNaAGhKwUcJNRPZ+7G0tnvUs1YLQpdK/4LdmgIHZy\nBkLf\r\n=itJ7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a03d56268723e670c630ea48a4fbb19fea7ec09a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.7-pre.1441"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7-pre.1441_1592801949441_0.9278144547201335","host":"s3://npm-registry-packages"}},"0.11.7":{"name":"piral-pwa","version":"0.11.7","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"35ede9d7981bc2ac550f91e7238a5beba1e15fa9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.7.tgz","fileCount":25,"integrity":"sha512-17VVsxY1LS/2deMw9DWpae9Nazu3zkpR2DldO/n7/axDM4G1aLvFmpiK3S2IMk9wi5SczNmfLI7h9VSb47kFHA==","signatures":[{"sig":"MEUCIQDOWw6JY/dXi90C9XfkVxjsCF+2bQaWVkey6i0alFDNLQIgZ5f2VRE7uNcRFzTem9RPYOJmLGVpemzGEAd31iPEhU8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8FJ+CRA9TVsSAnZWagAAavcP/3HQbovupa3EPXdDFIY3\nYePZ1H63eXyNfxCrFXwsmmk8FVgEoyifYvUQ4Hyb3BnvrFFoYfJOFQPi6Ks5\nc/H9UnSSqQTAtV9oFzHjyPtSyCWZTy06dJeP2lLTz4AFntMpBq+9D0bkm0e3\nJKN3hMv5N6nGwhGQCv3NFLs4tIucirINbQUNae/J7FFc+HJvgcfkRO+Hyd7/\nnqv8puGrWdF3WV+MdEHBs7vZrGDbehpyCgYSdbeho3Qqnw+//kphPcXt1x7r\nzQeqCpfOc3/kMXqXy1Qpk4FaFQC/Z9rzz4rdxYdOCxn4KaIeE+dfnal7Y7sk\njXTdSbN9aXuT2XMNjFPdhwqj7myACuTfDZ/xWIWHhV2+ZMhjjV28Zu0/0Q2G\nYZKeNmhojlfSvOcXIa0k6ZISJYt3wWQEc8aBVA0WZP2U1w+ySp8Tewqxbw69\nchlzBqEyY1bH29ykJ50i02qqlcywznUAQyJEyazyVN4oi9u9wEyoA+lEO/xZ\n1etfTERR8rtofVmrwWfBnA7nkM/A+sFbhLG/PLcIvn4KWHqzKTQwVGyJ5UR5\nqPH1x34luQc/HjAQBg6xjGVx+2VeiaW2dUsjUTZkf0fIXdsPGMiYtxcMLrbZ\nJfiMoOSAkarZEo957KgQSlM30VF/tlda2Q7U+/Q+pSpRqL/L/G8pXbU28dc7\nNJIm\r\n=GhkW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"cf59b6f518e6bf63f287e7ad918a633ac60cad13","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.7"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.7_1592808061676_0.8510552014710808","host":"s3://npm-registry-packages"}},"0.11.8-pre.1446":{"name":"piral-pwa","version":"0.11.8-pre.1446","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1446","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4546fbc793dce3912337244cdbdb4ee6865a6f58","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1446.tgz","fileCount":25,"integrity":"sha512-s/LXsRwkoyz+kA0zz30HE9zW5jcGJvPRi0efhNsgB1rglETN18dSGidv2iDIcY3ficwyHny+xZKY0pHNjHQQlg==","signatures":[{"sig":"MEYCIQDKtM/GwwnzygRk4k00vI5wuigGk+s3jjhS8VwEKGtPEQIhAJz4nS2LyYXGc1JfQO1Rd7u1lTvL+OjhkpOhwkxYD7VN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8LWoCRA9TVsSAnZWagAAwOkP/1A/IsNmAqNwfPZGAcHe\nOR3bIf1sL9ULvybEmaPJbGOB7x6BqeMqIO7dUZ1d7o7VGynEre2SGycA7erS\nv+3Uhe5pw9NioWty5ko086cqd3BTT/Al2+UWyvAi52DlqBjLZKchH9/8YZzz\ntwWPsxj4T6rHdlp0/uoDJZHH5dsfZrM+Cf139rmxzqLcDfjxXMikzpVpDjZf\ntSsnrorj+PSLJUrGBB9DkW0Jyxb0S5ZxS+/ZsRE84tRSZ/tQkU/PZ+i+ndOz\n+gYs1TFOTh9c9BtOwUVw05wxoQ4o3TIfd92HrCHEnPvxdkZW22/FBo1Ck1tk\nHA1fLzj1Tul+JbCtr4VKJWhbFr0HMGZxw/tZTBuYB9PJJhMpU/9CyloHG9yK\naNEm26SU+NTMGjZ1HOWmdyiAEsjnz1O1I5fLM4HkNh/679uTqxqlk/CV/aR+\ncYUoc8tt7SaxkALDGfxSkw9HAb+lSGJWquoebu64uuyRle1RNvtImwv6rE0S\n2AwgOT2GAuOU28iN7sh7KFlA1T31cUT+PbDJpnu6UBzxxVwBwDkq6mYIJ/70\njxALIMjmSA3r/SItM3OWITMTda4fKxBM1w1xyj/v4PMReUzQ8p5oNQLc0Oho\nrJ7wJrgK0fQDM4RcF4IZif5HEk4iVOJ0mOKZHP3pmysLqleVR82keM3D+wYv\nga8Q\r\n=34y3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0abd6be5fd40d921815e6c937a2931c0e14d63ed","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1446"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1446_1592833447457_0.05126684319265995","host":"s3://npm-registry-packages"}},"0.11.8-pre.1447":{"name":"piral-pwa","version":"0.11.8-pre.1447","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1447","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"38e1efb4c57eabb4cf32851bdaac3bd3f79b0e51","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1447.tgz","fileCount":25,"integrity":"sha512-o3wZUKr70z8UDqB51aS90N+osUaqyySky1OdBdfguYvZZ797CFhkWWeToImEtxuC1cSmhHibXhldbDyQY7+dnw==","signatures":[{"sig":"MEQCIBj+nEaiafK/OP8Hc+cML/qEeI+LQG9Muoub1+erJz9pAiAuEd/tC4Q/9DHSJ3l35RSoVBG/sRTes5gx+k52lTvkCg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8xRgCRA9TVsSAnZWagAAopUP/2FFOAmYCtVBoeCE26k4\n1UEAClMgBhhj77lwQ0BWbet6bBNt9sGlHsaDryRjT5AtId0IUX6dy5HSJ/K8\n8+lLnPavD0JTiO6uGBsKZNz19H6hn5FlepiC0anL3PjmWaTxTfCvTTZ6/rh7\nSOgvEg52XEQeIPuLnIiDe/lVspd4yxyhwY8HetCkI4J9DwckfwMqqK8ZSfR5\nh6rKljhXPCJENAKPGmJBpyF6qWnWVubPAO5ukqwS9Hyb3PPoy/JJCplDeoxJ\nrjfADYfRL88Rgetk1xe7bUumrd2YNabtFB58d6+yKah7M5N0b5/IRue5mjEX\nuZFxHJxQnSzkv6bxxbAEh40IacEQBvcCHL5Ggr5ijRFBvITHIWbdwy1jfaCB\njBuF2tCqeFcG/pcZPPVpLmwbaJK+HqPdIYnMIxu3d6s7gGwZQIFUrvIo7iq7\nZgWQ3S9lFgUrdjVJm50Su9/y3lKKeJ7WTzv5A/q/keDcokbgzr/t4AuULDuP\nVjrTkbEVJiD9653kSlE5YX1mpcyz9v5F5OqIshnNWyEcAc00DYuSrG8bfks1\nw/VPWewcKwJk+9Z2/FTVHtST8HdljGw3kVEodX+hrfs3QWNHvgIDIfla6lA9\nXNcYXww7yRlIQ+hWA5msMxIjOGD5znDeLqMddjbcIv46LKeKE0mIADA+8wAm\ny+4P\r\n=WXel\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5ded0c1cbd61cc1ccee9902e5bd2a7568357578f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1447"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1447_1592988767795_0.6494185524509966","host":"s3://npm-registry-packages"}},"0.11.8-pre.1521":{"name":"piral-pwa","version":"0.11.8-pre.1521","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1521","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"15f15195e2526836b3964e7d725c54421a0d816c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1521.tgz","fileCount":25,"integrity":"sha512-EIFnSTZbvnNvWpvaXaTSRXcpXrUThlIA6OUeAEbO+gZxEmClSS8hax7Qw7OjlvDdFqgxKwgfXYZvy/2W0AbPVw==","signatures":[{"sig":"MEUCIQCJG3yYHVQQ5Y7xlyO4k1MDV3g0UzPwFR/oI+jOtEpv0gIgWemt95WQBDCadVQILARXLWbHsDf/EQbJFtnC14GpZuw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9ahtCRA9TVsSAnZWagAA9WcP/2Bp8MbkrycRj+Gcim3I\nN6aO61xPARoaikcSu7aXu6BgEnBq7ASPfCh3qsicQR9AV1bI6qEwpoOqwXMO\n/Zseim7sEXyU74xN/+I3M3qEngt2oz4QuAIYO9BxIPNfnW3nRKdJbZuhS6rZ\nK3tsmbdQkKzKLzwHXDDxIK7HY7PVLuambAAyMIkJ98DjmLTv0SwMKlR4DHpE\n4N+hz63ZwIhnFxVh24w7DIajtp7pHeBc9V482bPyeYu5O5qlE3uIAPql7UAG\nawhqAx5/C86KTm/GNHj0I2SrzDp4Wc4ZVO6u6dboAYx5Z1KnamV/5dwesbla\nZ2HR+qQaRbXZLJsDrvpfnpm4NgO4tXeLQRU5fWff2CqxTkjRTkV6tnwLYbcZ\nhqt7UAHaX8bc0uuPYF3TUEwfdp1UrkbdSprpZRZCUjp6f0fyPwYIK6bFJicN\nYAi9n1/K5Tle/8WWrbXH1cbYt4rwH715EC8eRao4F+EY2/Ikar3GBu4f1XU4\nQ/qrL10EPm11JMAU4rCkGmPi4moSec8CCTA6NgHMDt4cYdRJIQg5lgJf1+MM\nLAscxSiRQEAK4ISIGuN8OBURyn5yVtcE+fbqOKBqMd8TBITxQ/mAV9tdgtwS\neP+3Fsqoamd1hh9DdBBNXRdn2fOY00TJMXd4Np0aPabJJvzdTl1sVmaiPmqx\nZ1AP\r\n=X170\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d172b778da850708e881a3128e7315cc8272f68a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1521"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1521_1593157740377_0.4902066655219708","host":"s3://npm-registry-packages"}},"0.11.8-pre.1522":{"name":"piral-pwa","version":"0.11.8-pre.1522","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1522","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"30de11e0598cb42466c386929c8cc1ba5fb41211","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1522.tgz","fileCount":25,"integrity":"sha512-RIuLNGFRSzYyaTYHFoc/XhGVJOp3pDjP0W7y6cIg1WQc/tzi2vq0CW4BeGGhK9lnUpmfnuMirxCg8XoKYprmOg==","signatures":[{"sig":"MEUCIDdjAMEksvl46P/QQ8zfU8iPqM9GxES4n2Gi7NjotLeTAiEAnJVyKnlAmjfVDednFN5udD1Kv9MH7aqRGlD6uHj/WHw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe98+fCRA9TVsSAnZWagAAoHkQAI0Q7WydYCvJH+4LXiEU\nHqfwfw9FVWEgF88NGt8BFU/3fKC9K75aNJAS5bA4dCPP8fWY7BEfI55QKWTA\n8pyxi9/6KlYdrA2kmXWk5vkXzjmIvUYBkqXJmiOufiGQUau6da4bYIwZeC6W\nq+dtAzZOSWcvE/7SF0bB5fuLvB6oBVma2xRWii9uZwMHfDxqkUd8r/DMkGLJ\nqBBGyXyTJQgbYOapNxcwN77AMJM8xkXo4qQPq/OUh+Cj9JUkXAP2G2sL9AIH\nGrplO1DwJSM5wRBiifTKUXCbM15E4eF04cDU78y9UGar5sAV1u6YoVITKIOF\n4lDWipDTRxCs9s5QDhbAcqLReqL2Km0CasTzWIDrHTrizLtyAz1YcO6mhUW0\nLYUq31ikBllWVB9pQb3MA83Wm0X5YZ+Vo0IkGMKASaM89+kkZ/R6+QtFjUXT\naZC3GInU11x0yM5zlVFgy9rwzyA6ZgBQ00/l+T/gn5XZWbuy+2uEgR3x1nLV\n0MGPmpN/BBFC38pXtaKpIjsNXUp4shTc0xpX1dk4T70iMrp/mgy2n1CJXxVc\n2oVrjTOIwVdNst9O/oNF+JWJhtpBXaDNHY+Mu6PsEiSdht9j9HeAl8kj/G9l\nsU0n+dw+aK6OmQwoWz/LVaJmZHMScHS/walndP60n8spe7iC8KbgJhFmCgM+\n9W8U\r\n=5Vj6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b354823bd0a3be383ff31c87bebda57fc569188f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1522"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1522_1593298846845_0.5733778596500467","host":"s3://npm-registry-packages"}},"0.11.8-pre.1548":{"name":"piral-pwa","version":"0.11.8-pre.1548","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1548","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ec1e8403b79e4c65c291ce16671f557fcc28c8c4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1548.tgz","fileCount":25,"integrity":"sha512-OxSTJqS9RpXx3VkHOq3jj7d/74jKtB0EN7NuWnTRSmAd1dd7COncRz2ANYG+SZDPn3OjghVL/2Hkd5sG8rSqgQ==","signatures":[{"sig":"MEUCIB34IZp/nCBpTzXurCi4G3MRMqK5UwbzbfaW8y2GyQA5AiEAnbIspxVko6gRokaKxFXHPHeN64q/sNo3nhDjJE2mSYc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+m/ECRA9TVsSAnZWagAAIxIP/3Il3eUVkVDYO7UDvMie\n3gJlW2Ehn06kim2LO0toz0wt/zVRvOBoc8dST7esYWzFLiPFGfpyZpWWkBXK\nIT+09FnBBfsJXE+ipwZ/GX6MsEJHR04ekACRWu2mOLdzJx0Z5zoxCBnMYi/W\nXV7pnbFVd2gDPtySxiopD3MnTohYkbHNwAFBIxHQs2IeNMc7+l0SWfb53ZKy\nunlcnuHLs9L0j3lx9tV3ZEYt9xvdqBLfDdqPOZ02bnQFzdo0arU0ylO/lLv2\nK2QxxTSlwEk2Zu0punIBvNZ2hlu1M8L20k//Eb+V1cKBg2cDSLRrB5nqPXl5\nvn5r/jsyuHqfzIKSGDUjjPI+HqFPAbLLvsEgH93bQI50RnmV+kvnS570FKf5\nNuVvGq87n99WvylKO5eWGSL4Ov43FXOgVzixPSzR1hFBzslH4uks1dkogPnB\nH6cnNPYGbUl12CRUN1I5G9UiRZYFRyusxJv5ogLLy/6LF3h1c9kbN+N4bZs5\nD/S9NC2/gpeXP7u8FUTkHGtleqLg3kA8RQqUxgW5m4Udk0yVyYryvLBPKMwa\nX1I/dCKrerKFk0vZ1tTsn4GBxd3gQqsYh3fmfK0ObEuqUgCeYOY6rMdy8G6G\n3hY9l73pgpMyt2buKGE0cUF+ZU7ON5UGsHzZpgamhZhRr/LsAzJt699DNqPo\nmeP7\r\n=1Rjy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"6971747d4506137f579597e1ebe6ad4bc2488acc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1548"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1548_1593470916510_0.47819651705513655","host":"s3://npm-registry-packages"}},"0.11.8-pre.1560":{"name":"piral-pwa","version":"0.11.8-pre.1560","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1560","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9d5a2dc43f8b5a6e897da484dbeb0381c6a43187","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1560.tgz","fileCount":25,"integrity":"sha512-V21UiPrXnH7y5K3HPu0UgnFMrz7vfpdV58w3rOIJ4JJYZy6xyJI3wTF+3q/+6thOj/xHIDtav566GOfEY2zl9g==","signatures":[{"sig":"MEYCIQCYotvUZiBUetRCNiH1qvr2wacDp85bjtGLyfzJGUcBdAIhANHJC2NmkxyS7Q6IUMu++cxE0UM2Yv3WSZXr3TJVQEuu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+04FCRA9TVsSAnZWagAAANYP/3kEKw/HV0BQjWKhgBpP\ntv+MSe+2YNwzu/FF1Zk8vaRmjl5zUCYCaMBqAHcoZqxf3lzyV/SSfJLbI5AE\nz4/Nf0PzHjYk/yXu6M5OvUf5OKsLhadLPJydh4DfMkRVYYd8/TLIjqgRsPeB\nTN7gjAMLSO9/RO+U5DjB1ijyPy7qYjrb0z2IdlU4BogsIr9mtKnktvnT8jcF\nWfi0aaKnDGAMfa48euO+LMwauYNPGZsp1op3azjqapON6WlRpEGb7nzKapLk\nkfb7Lq/SPhtOEWYbw0bAIuewqCfVADR1fiAGgoG9wvFh2aSWiMHrhqV8U7GC\njGSQbBPduFWkRnlKh1BrxvkfvKfV3po4A/NXFje4UnVtn4imDRPQXh8d0ntw\nufcBPurw96kxQkrZgFjhySYG6DSznQEUvkOgwP4N4kgaU0yF31TF/kygkxav\nFw9If0862o2q08WHYOOwVt20CjRZtFEgJcW3lgGq5c6W6SNpd/oHZco39VU3\nbRKf8NdfGC3ShmUlMQ7exz82BjGQtPfPgvlu49WnC7b18gmWYkLhykHcdgVe\np1HRuHfsxj2kRUQuucW7500q4u1Ky40NqwJ7etbWEV80HXXl6PsJCeW9IEWV\nc2SVp0/vE6YjtVYAbh9YwQvEybb5zu7fi2NcrAn/xDhHcMjJTqnG6EuXKNTh\n9G+N\r\n=qbDv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"be78be619fc808f782fc21983131556242bde503","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1560"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1560_1593527813409_0.07567330513581405","host":"s3://npm-registry-packages"}},"0.11.8-pre.1583":{"name":"piral-pwa","version":"0.11.8-pre.1583","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1583","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e7427dc2947d2f1a0b6341ca957bd16be21dcc6a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1583.tgz","fileCount":25,"integrity":"sha512-nsod03gul+xwUD7VPxitn0D7M/OIaOxQ2Cw0IEksKHGuPkGV5kt7/VpRd+9NxypW1dOK+x3NFKiQS/yi7Gym2w==","signatures":[{"sig":"MEYCIQCxqXvgKgd7YDCbcmmfAGksvJLPYhk5clH3QHHtOxDnEAIhANGqVyAYhhJXnhOi0x28tKoTERVp27jTIIPoqv0hbKbB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/ExICRA9TVsSAnZWagAA0k4P/j3sUiRqTgAtqZZq5rb+\n7mh9iimVIgp4EEP+SZ7S8+8q4ONbp6y9KG4Z9RsRAZFYkBIxZwMEMIXOYoZ8\nvT+949XzBPxYk8PEJnzkOa3Ppieiq/1QnmeENtsAcTJdt2lso1YCJh3uc2Or\nqdN1F7F75SsNyzK3dzjqMV1TMI96xI+u3bcvrDumTlLaPjxRX8HJmF+UwmpP\nzCFmBsltp5Q/acGmL9ulzo9GdoXAKdY0684GgCkofxXF5jjVbVmHGBRRN73n\nD+WwtW4BASWiUvrf41UHkyZKGnPC3yx2SyZjs0aYp4/1Cw0GBnhm2w9TnTQ4\nbwTTt+iMK8roTU8nZpxR/ynoGXm4aAwF8DGLBIvT13jag0s3+Lb1ztFpOm0s\n8FyYW7nEAUwva8IxdsvDzm17SiVTQRKQzXnLa7Y9lHF2wyvnatQiBu+YSuY2\nRow+6Xz3VlroOsKufWqWXDmjntdmZbu0AjraMWWXeBcxMN1S9U/yAw1uFJm5\ndPLkMyidOTOkHhsZQfwVkTF/jUU1WqDDuTzKnAiwmS2e+mNgMUnZ582MVR+H\nNonvlPLEq/zTCw68MWLoKr15/ZISN9Nq/8XCzLt90EhwdtHC/UuRhz5j9Iv/\nG6GEUfT5BfRXoiH6TDD7M5CKbeP7iLNHCgEM95/SEkZ6fmyJDDpuiG4ucNPe\nbzQZ\r\n=Rv1o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"67ef5310c88379541e595e4818cfe996cba1f252","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1583"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1583_1593592904230_0.26043930124134107","host":"s3://npm-registry-packages"}},"0.11.8-pre.1591":{"name":"piral-pwa","version":"0.11.8-pre.1591","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1591","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"846e8b5f44887bb52b6c5fac021e032f355f1274","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1591.tgz","fileCount":25,"integrity":"sha512-RV5kb93LaKyd4ZiIIoZ9yDvvoT7ikqX55rE00IdtEexxlIPPCdeD7wWcEj4hB59YclokY1BEaU1HeUotu3RMPg==","signatures":[{"sig":"MEYCIQCHGjyfBdF3mgQYeIqBw6m8eeP59YoNxdz8s1zK3ERSrQIhANhHVE2BP8wMQWBu7jWMIGh2Xig6NP9c0Og7zvctQACn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/JwFCRA9TVsSAnZWagAA3OMP/1NnBuPoodpYEw2i5DP1\nn+kI1X13qg6Q+QNX/LUO63/bzzf0Mh99grIr29gnElO8cV1j2E0VZZhMTpQ/\nA3bpRGs5QLDbWiQUmHcuiYB53kfaNqdyyEL7LcIYEOgIUa1yTZbzBgMR0OIX\nvRVCyDGm/Q0oyPHPjztvr6R0mo58nbcIkVhC1QNRalkHgRbmP7UTzCFczon5\nRo3YZTi1spmoR4WX2G/bi6PD/o7CAzMv/mfReKUC8FjNgZdx8wpoHabQ/SWj\nJKG+l0Nwnd23Lkj0mLlHdopkDaihuQAx6+cTf16EEdsaLc4ET6V5t4gdV4Zo\nB/pEgRCBlIAnBtVLwBkkKE00VMpE9tIszZF/9xA0frOLyc7vnbbdBp91dhha\n/pfGer/xjdbAxqj0q4XYvx8A0VwClnrPVFZmjfEtALlEcugqLCmcbGFvBHZN\n0pwCNHEg7lkzODcx435loNu48tU0+2iKEdNZqZFnIlXzg54sO7Q/O8Qm8wLI\nrQlc/KVPqQ5SCIF4NgqtkjbyLfJnbwXoa9V97lEnjIZcCanfX7cE1NmFLCqd\nNnNEsK6RObqp20vRa59rQDjKLsY4kSFj2rdV+kMU5ZgUHrfyHrFSbwNfQua+\nVvtxt/FYne1ZmQhH+k1Mdll1UiSns9KSsYyBXoJCmO/Rwxj/Q+38YlyzHo8E\nGDre\r\n=tAI3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4f994ed998506d367e90b99ad2ddfca8091f088f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1591"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1591_1593613316684_0.7589019954996661","host":"s3://npm-registry-packages"}},"0.11.8-pre.1595":{"name":"piral-pwa","version":"0.11.8-pre.1595","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1595","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f1f43101894f76613f0390dcb34bf020350ab218","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1595.tgz","fileCount":25,"integrity":"sha512-FZYX3qh2RBEoTIR4R3M1Cafwdj0HHR8vrCcA2UcSCHAYlowWCmHWui4+uXXwPrirIh8+05jQ/hEb2v4hU8Mj5g==","signatures":[{"sig":"MEUCIGyMiq+DB0zQVttHlzEDIMz6Beo5OBsSqMjJOzgxiUHNAiEA/rGsDEXSvWJyABM3xFrox/SpHFSzG9XEJW7UsnxmbKw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/MevCRA9TVsSAnZWagAAKrYP+QElNkwq6DzouyAF3mja\nr28IxVi+wCK6ChNBu3qHq5KHBI+HEdKEN79y1D2BCahAmIQKcAHKYTwXp3og\nuGfPgnct3weqyFHM35hX5ge0L+EqULzVwqDAwNnPuDigk34OD8W8Ea2uca1i\nIHFgmRyu63V7peDxOSSBGuJkxq03gb3wPTXWp2bUvBJOCxrwt4mmOZd/v/xb\nNwi1qdO7xA/9Alz+PJGOA4IiRul7i5PEX3gVfBECcukGSM2Kn7k8NXSQU/P7\nC7Lj9mI/B/4crucCB0B0QOyHW0Q5iC6QAcoIJnaM1/P+lrJ/H7cAaLb6dcly\n39ln6nWLW7ou3eLgX2dbyG83nU03RfGZ/5734KMZ+woKbIKPs5AUcTGGSOr/\n9Z8jxgKc29b70fhaIYOScgxNz7nDIYfe6rbb7oNlQrNqSufOqz0sUiOj4oxw\nJ/uP0wBmu+WlgXRXZtSfPi7HtXbQV2ZkRSn/tLWJkmgJ7MKB11tfC/bgxHJo\n88NXMLUK1KoIf74dPOxd5BlPhpdHOhbfquOBlnzDJNJKI7HQluq9JeTKGri0\n79nScbhdXRHBS9PCP70EO0lBHua5Q9U+6qn/1CCwo+rN/p6fdOk5vkUvkVmr\nb/xN4TBqSB2SoNr4RrWc08/2pbD0byvZDzN+/XMFrp4aV3S85ZvDmEOLI6ph\n35tD\r\n=YzVe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"be1abdcc074bcc6f2fbd04949bbbe06de0fc470e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1595"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1595_1593624494660_0.01655783744935535","host":"s3://npm-registry-packages"}},"0.11.8-pre.1596":{"name":"piral-pwa","version":"0.11.8-pre.1596","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1596","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"32a687cc7611fc84042b1aef30939d5d6ee0be60","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1596.tgz","fileCount":25,"integrity":"sha512-TMTdjWUWMXpGnN1SdlTnvWB/gwy8VAEu0y7jx12WkaBeYufsTTJCgrM79JfAcjZlIpDHuBZCfBbQlChgZb0C1Q==","signatures":[{"sig":"MEYCIQCw4KCtQp4lSP7RZwc0lKRb2pHNeeW3rtQIn5vvlXdiCAIhAPZ6C0vyHFLlKs3wzIoP23k+WWAw6ciJg/sWaQ/T/gks","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/R0cCRA9TVsSAnZWagAAofIP/0QQARUY8KAFspmVeQbP\nWRHgT9r5yK+5VCJhg19nkG4uB1Qbn7+09aUrmGKn/sELT2D9EJszyWZOyQxU\noIjwr6gTKqNqHPEEVNIlGIG54qQPy4/hQgCH5x0Z2o9evFRQvRmC4AAuLhAs\nAaVZA4ND4QCYT/KcI9xjL2csJUerk1pg2UJoGeFnHgOOclNLUOcCF0dxs/DS\nXadd3qhJpNnp2ElakhB3Gn0tadcK/0wBkzQpfOGL5yMoaCjgoHTG78ZaOSDK\nOJM2yV0TrLJ32/l1THD0SHu1nHQ6lJ6uo4YzJPBhxqAtuSjez0zmCiJa6/lw\nL+Yt+4E2bA6Vr+M8md4KYIl4yXTstEC0XPVPn4PgBnQSR+k0ugZhkMkZsvpp\nDFPt5XBCB9MzKSHEyG9UyyqYoDn5sofUGc/6H9wvbYvk5TZfwSFNtaAU4R0n\nRME5toBIvxtl//hjzufEo2zs9Map0Bnv5Bg2vTtrUP6qvnxyvORAR5RZ+9na\n4n8eNIXC6jmHyhPgxy+h1H0owZwUYuX7XzRDHygyVu7Zgfx9/G5ilcKnhWuC\npJle9tCYoSkEiXi/RvwF9HCLguP8w2d8+qzpzkrAUZpF9CSwJ4YOmWN7ShI1\nm/jfSkOfQnNiy/ZXiWZcrG2Vtz1Jk1UHlaluAfKGQvAyRRPMfqSFQx5EDtkW\nx+U9\r\n=GVoo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"87719c35ff19f40e26fe55e63553920607c7732e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1596"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1596_1593646363802_0.39426309454814534","host":"s3://npm-registry-packages"}},"0.11.8-pre.1607":{"name":"piral-pwa","version":"0.11.8-pre.1607","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1607","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0859252847ce3611623d1419b59869bcece5fea8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1607.tgz","fileCount":25,"integrity":"sha512-3YDlVgPNdCbP8psJ3oiT0KfYkZMp2Nzi0+3d4zeFL5eRMfDhNMZFsUifU4QO2flLxhzRBir6k6WCSezxF8PM9Q==","signatures":[{"sig":"MEYCIQDkoifayjPDe2bN8bjn3w9nOQciHBVdjQ1rDnB1MXNkoQIhANJf18Fl4iTC/6nm9lvRT1hYUt+xB+/84z91ftL/z84k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/y+fCRA9TVsSAnZWagAAeXcQAIJnEg2DZyhqqgoQJOtG\nDAgWGBhBju7OByp4g+92YH4OqOCZEdestvn7DRTlQ6mQxSkrhQWA0oQG1R5V\nhKbP4XSpTaP9K2ujm5/lN/G3UoKdjCVT5ig1i16Ti0ckaSEbg7yfUwhkDeao\nc+9i0iRKw7XcxPyDCKDVQrpRTB7neyUAgYi9ONTp5jh4CAjBTEpBYnqnJpfk\n+J1BezhexfPxbpMtV0AZER96mMdNEJivqI9D/kUwqvS7KAXuwUfdHPMEBfNG\n23CHHPaSYwrqOoVTl4jRgHcYQXGIBlNYk3E3T3GSm2D9bNlXvy2umbpKSrCG\nq1jfCgkvoNpV7zgUypTDtxaV1mgRdsLDu/psBUF8UthADTHQqkMpmC7qv4yC\nIn7rhtKrTdw3dsf7tZ0W5Li9k1YCp+l9Ym6GAafBjfleFc2xms5kNnQJ6Djm\nw5KXCYGLk2dzCTDx6gELqTIGlHe+2rcO2/qf4xBvx3vABC8Cs36XG7ETFEe9\nvgDq5M1hP/DvlT3fWTgC0PI1ltZSt7vbkHWZ/yN3rZfgjdW9VCWqVXMCVYii\nnpyDUTtyM8H/BVmBjR+K5/pI70dKGvg6SN+UhFbQbA9pwpfyqQOsdfb6FwGK\neOr2ywzx+1/d88geCcSpp4teOhojoifTK5q0eHZVWMGvNkSWbx38vm0v+CX/\njdps\r\n=rQWk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cedd42b825516601cd989e1493381a91d2e1e5d9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1607"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1607_1593782175167_0.9084629366475772","host":"s3://npm-registry-packages"}},"0.11.8-pre.1610":{"name":"piral-pwa","version":"0.11.8-pre.1610","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1610","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b4163439841eb9399e1aa2b651a778af8e713b24","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1610.tgz","fileCount":25,"integrity":"sha512-pmjuomszMU+xM2NHPN3Pd6VYu9Y9npYEvoFvfibphJ/hhA1CCF6uz6MXw+lH6klGTEolV0MbB10K61qbnfqPTA==","signatures":[{"sig":"MEQCICeP9dKHfMXnn2NH/2ZQ6PPLINLWxn2IWXRw9IZYqwICAiA0SfXdwt/0DoFsTANmdmF9uwzE+WvYG/DkzIsz4Tm44w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/0rICRA9TVsSAnZWagAADNgP/RoRwQyRYT/NwMDuJoGX\njnEZo9fuhZlNTM3G6EEFhacQsXBD6qlEj4IyyR3PNuedv8XV98YTme72trV0\ncP8M3oxTEJ4Z3zdHpdQ+pRBWyykuaAylkTet29ylU/PWkyXR0v4UqJnXWry+\nmu0ZtcjIrya6LN97cXNxRWdW9HU1p9lS87UJy5OPwyHcFw7hptfRlaEYUMUJ\nLcrIbNJtxb1EvvPx6FiRh0YNNcOsF7JRx2QFtw0S5t/PRxX428DLXjMnxs42\ndUGyV7392JV/PUB6dGMeNl9s8+XH3giVnRz8yp0/q/mhFsTTpQ05A9KWgdef\nLWmJI0mlxMjOkPMuORkbDWuUxNBMl17amuRxZNTMIt+bv/pc0J6BPa65opVk\n9KDu5SaDcwM2yKMWXZA/64BDTVYMLM5KPkzDisekfhyKXjwGD35K0VgfxwXC\nW3pgXNf5yxRO978BLaAJpQjgJTrDIMRVPEA9gj9r+IWJe9XLVfmhF+oz8t3I\n2SP0tda5zAUeTE1XHwRgvMpTvcylDur26D5hVJaKe+0pxc0atSnanVE6Lepv\n/GYQBmLhhPbyXKvl2G4VLzBpWgywPQVJbHAthhsFkFmHQuE/CgXZXtVrblar\nTg99aPjiWRPG+3M/g2fW2Q+K+G5eoCQeMSl+BxAkgfxLp9dGCf4wvTgdJ8mX\naPuS\r\n=kak5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"655b59b19f9696177163f9bc91d0a1aedb1c831e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1610"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1610_1593789128253_0.34283470505257796","host":"s3://npm-registry-packages"}},"0.11.8-pre.1611":{"name":"piral-pwa","version":"0.11.8-pre.1611","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1611","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"138f41f3910fc4f661210651f688d89b67275908","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1611.tgz","fileCount":25,"integrity":"sha512-nct8+iF2KB16Kd7+09mYlaf5bVdfxr9wCzBtpl8aRfTdYgxhl2qu3/BcoP8MtN8r6F2b0la+v9WDFJw0+VYUxw==","signatures":[{"sig":"MEYCIQCuPTjU81w6j17jVJFSyKcJLvBNZiKSqs3nXsD+WOwzMwIhAN/pM9ubWq1OCRd1rjzfRWbCFPK6WCslPSKYTm4xeC4X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAf82CRA9TVsSAnZWagAAYf0QAJkUkfK1j2L7jWwynnnv\nIGFP/ryv0pbbQzWU79x+zDp6GjFP16qbVjGq69nENF8kc2cetQV0lKX2RFdJ\nbfiZ3bCZZYXl+CxTIG5EaZ/Uyl77NKW9ozYA1g9BKfNGPEb9qZfID5tyMPev\nLdQL/g754F7WCUetfzgX+CwOnjR9YXX+vTo2tfMvpMnqFdy/qabnc4ugLOks\nW87AQFIShey/oNIxm3OWBrzQ62K/ZGnFFFFWw+eP1l3vLl40M0f2BuywSqMR\nc5uMs0VVYw45mNbI2XiIOGWtcj+3LNJR4KzEDXeRJCgaPuyOEEJmKEKMPRjY\nhd9PQhQV1nelwGhI1wa7I4P5aUxYeXFD83sWbayNN7aQQk+ttLXVSxUmQO24\ngYoNd2e8dG9jGxTt8W9KkuW/PED69CvGtmrvDviVG63A9XC9nK80bmUavq1l\n/mV8sIiGvNepxpR374f9cvLLGmcOSSfVPWA8EQsghKX3FBfB3SwqQRNVjR11\nN8JOb8Ki+JbZJ2xXYrljhkpGPvawrVZWxzM+/dbJp28BeAfWEqujun5otYth\n+1utpD27eutXgav83s/J5GwlRlZaZxfLXm8Op5gKspTOBwRQprc62Sj0y+Vi\nZRQ5CIQ/VAqJrV9FgJAPY4I3FrFEoiQrrSb855GQu2Sbtz1OhEA2KPAhcPHQ\nTcec\r\n=beBQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1b11dc71bc8ed0f058a68a19810b7c9460142d3e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1611"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1611_1593966390047_0.8383534448366734","host":"s3://npm-registry-packages"}},"0.11.8-pre.1616":{"name":"piral-pwa","version":"0.11.8-pre.1616","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1616","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d62599f16ba1ef86bdb1983a6b372e053282cf74","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1616.tgz","fileCount":25,"integrity":"sha512-RBJNCK4dZWFrQnTujxWOanZprtOiFAZQxpATnDigxa/VvIVMw59/8yFiunl0hxVILn5mVMRJu3IGRSKB1uDFNw==","signatures":[{"sig":"MEQCIB9OXs/fC8E8M+yaJNokO6VlE+YD9EMSytaElOolhAv8AiBiqKPg81diQGVWXCaxmJqB1KBWykfafpHL71XFGJilxg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAzLBCRA9TVsSAnZWagAA7RsQAI4q63Rhu8rywadd7CRa\nq5I4LEdXXwwYn7dbmhW9BZBXh9yplafAdvJj75ImU8/lHGdFSmdn887m2Zf6\nsNInRk7BWFmn4GcGmGnzm7Aw9HJS7ZZIYeeEg+C/B3IYZK7a3m2Wv+8ScMde\nC2isNekT8SdgKDa1Pu9fHmSr4PTjx6JX7J8nWmrRHJXsKym14dAHhlAkm2j+\nTNRd6bCGu6PiHQ8JUKblS1ZhM87AcgYIxXVKVtFJ8pHKCQLhkZjEayT5/4tq\nGbC0GeAtqRocXjYYRnyBuaqm18b1ES/y5JLox43xv2lmyYSPUWG8Uxw8tLAT\n8NkvX+hcDMVHaDAuiAFjVRfRojTwEsPgEtlvLoHhsHYW7FPsjKoDysFaKWvA\nAoAWBGuugKoQwxGjbjjo0liTXxTR1O8TTIq9fslJN0PjqvqhOPuAEzvaat+v\niN0DWUt5GHNgTLoiAuOzGbnDWRgaWDDuzlaZPumVqrJ/ADNSK8hG89hSaLHR\noFheurIMyOuLVSBYOuWHoaLKlr7/SI5WIZ7Pr034AJ6tE0iIwlFdVFwDX+4n\ni+cAhYAerbIUAUC4H4civfekVZBnwNwvcxj6B1qNbiX8EGEIKlpiZ+/Oo76O\n1jsJZbv/k3Y5V261hdR8hIxGes1qm2oL/cVu2VcpDCigQb5SmVvmt43coY8Z\n+6pQ\r\n=oWGq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8c804c01c99c45e0931181fa755117c4cf3a7a9d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1616"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1616_1594045120564_0.7982964699397774","host":"s3://npm-registry-packages"}},"0.11.8-pre.1618":{"name":"piral-pwa","version":"0.11.8-pre.1618","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1618","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4806a4ccbd92be57d8d0ccb4b42719493e3d9a09","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1618.tgz","fileCount":25,"integrity":"sha512-miiNysYtofk/jsCs/g5IOFFPKeCKnrQ5xd1hfU7qO6OTxFzYgfeJVov+a53IY5oqOzqjHn+R+2h0CBpL7eSDTA==","signatures":[{"sig":"MEUCIFgnqzJXogOKrpljwAyJFxLSoaLt7f0LbJHkYiYVGjB6AiEA1zYazWeMHnGsoifdv/ZwiHvlxvEy1H+xGplMRZ3kXJk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA9yrCRA9TVsSAnZWagAAnjsQAKMwAdO+FdarwPtG6ICH\nemqV3Cdf+3RUwpxZuNGLD3kNgwB5+n22CTbHvptTqyHmnH7JEseHjWJdQrvJ\n1b0TeDu6fFi8Die7vbCMwgqhbbllwRpD76GAUcSuD8xeCDGiPujTbYb7PW9s\nV19alikWNNub55y0RbqWyum8YTTydSUUxWdSEpP8rN15U515ePZJr4GhiK+A\nTyUFgZyMwVeUoJlEaLJjm2igygykrGS4RT+GIWbikLSKetZIechIcv+ewl28\njbQOvrlJAwilS3OMQQ3rkSwz+OYWw+o9I2Hzk1g96dAq2ZG/r2ulLFihnHBs\nIx1FrfdYOWuURcX/HnyzKt7twH6GJRK5SDLFNgmJvd5F9p9Vkvou+1VBGrLB\n4JvP3X/HHhEaj4eVvwopK/1WzwFJe3sS65/1VcYAlg1lIPG6FnHm95ONRfMX\nLTXOzQSQOz3R/DDg5GulN0tmdcC++ovn7lOd9JSaqXaxVw57jmtOO03z1Cl8\nPtcKxDZ+4jXHDr/JBdbfqh7+fR0xV3Ky8E5ShXmEUkx4DzeC71bxk6n/gahl\ntUI1wvEFOHFUkVWkF3CaeLLj/ExTYfgFbfuYYLXML0Z/1rmbr+d3u5orrU2t\nOf331QSvHVXtPM4TvZtNPBdVZ6YsevqsWk0Qmn1hfCzA3nnXkRNBWA3X9zrM\nl+wQ\r\n=C0Xn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"01bd7ec7c065721d3779103030b25dc66c20a0ec","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1618"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1618_1594088618941_0.15890596113227984","host":"s3://npm-registry-packages"}},"0.11.8-pre.1620":{"name":"piral-pwa","version":"0.11.8-pre.1620","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1620","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6ed507c0666a368b3bb7530f86c688ea37d51e3d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1620.tgz","fileCount":25,"integrity":"sha512-BbGgnCuOuHxjnXl2jO/RHRzDIXvwWHJEmMp/xPCYDd7iN15hX7xgJxslHzP/+bfQMrOYfVN6JSKVog932ymK4A==","signatures":[{"sig":"MEQCIENnxQFBynsr0VmifUh9EUXmXSKyGvkB6VUxhlUfffAgAiA0fWzmSjgxXX1vELyPuxmEwqzrpckYat+eBI6VDkWPwA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBIafCRA9TVsSAnZWagAAsuMP/2nYnJd5RhriOklH+WLv\nu1k3qXCV+cnkecKg78rWWhuxDcfif+cBr3ULY4nGNdXyCqG+M2Ub7/pkSQ0a\nRzaqrfhHvtdUmRG3itIbgPqyo4VbDd8ou4fdqxYcI+5M5cv2OA4rqB+HrQpM\nuMwOkwOSamp+3RxnhkRk5y3FGfjnLzw8TxWMuX+/+puhtinPM/5VHZjWroC5\nm6bZU9dPt+ZgRm2v4BaYV3Oc9Os51FnKu9LCBQNcAE/WJPy2+K35ecCT4XSJ\ndc2tWUnoEHT3wujiGCj9NeNMrG3XvKFglbk0whENZiP6QaRl2Bto5hy5Byng\nSk5R1GTSESO3C32vx216r01c7a2XEHCz8GZ3eTlEONE0N4XcZVjmTHvVSSEi\nVYfXZglGUwql6FXqRORzkdZ0mHRPJne3ldOVs+CAb3PaCNnhcG+m3E2z/Qgn\n4dZisM3GIVV5XohtOC2We9E54kaVg4Fey+HbQcW45lXMmkrvfz3d1KTJ6XGF\nYZ+ri0ADYPJxgYHRMNfLBmpG0JzvuV4hdCU/fEh05CAjyfvXZE6IhvXxrFFz\n13xicagRQqy99FPjRpkPkCwx0flybd4J41DQ7oftHhGTgz9zjZ7PQXToi0Hq\nb3UfXN9grz8eKR0M8vIyyvbLygKQ9ZOYanj2uN8ZgiMNBhe/aQZjY9813rOV\nxCDt\r\n=MEfr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e027010f23a5a9fbda79a2c6443d08a378bad1d0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1620"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1620_1594132127017_0.3906840794017272","host":"s3://npm-registry-packages"}},"0.11.8-pre.1622":{"name":"piral-pwa","version":"0.11.8-pre.1622","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1622","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"dc12e80224d8306196f747541ce300e2a0ece7b5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1622.tgz","fileCount":25,"integrity":"sha512-iscfwoN5xNl5KJfUGcCVm9o8J5wkNyidzRA9wpZhuJA2VMbx/vCHUym5rQeZsntCmfmGmWPKL1WEbpzp9k+GLw==","signatures":[{"sig":"MEQCIH5izLGhXVu9fKl4cy219+zs4uIuJt4LsJ/y9kwkjCYTAiAve5cOuxEQBYv5ShK/OJjmK13mWaf8WXjcTIz7wi0N3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBYPQCRA9TVsSAnZWagAAa1gP/19U6XzIk85MXMMZg16G\nX5K/6kK/ivQH42v/UAJgSk7O2K1TnpPcPlAWVvw+jz1VrFOpZnACWP4JUdAI\n75QPJv0BzLrKqaUl1ZUUY66yasZ7+LVeuPhUrEcLOKliltE2OH/FP0OCSsD4\nwDwpkrq/V8nsXw3Yvkl2pxSLwssRbwwnfb2Ip6uYUrbI5Gn/4hszAjhJ/2pp\nKnYegmIZ5z84wgg9ELUZFqJCgEj+V7m3K0bDQy6D1QiTZ/wCROBKgC0Bw1YL\n9VkCWNNXLJyoFTvGStrzUBBNNwUwNtJdI6oLO2n6miESgtIMza56fY2Jn7p2\nxeKyYtf+drqntc/p3+448+/jKs9NZ6CMFGpJUtaHRICpq8YcfnkdsVPFUJoV\naRmqMRU7Dl1hOCThJhNWLevigrzIpskQr5GNygkwB9lerPz8xmudcfJT2XUx\nzu/PjlkfNK/LWgn0/Xc6gY9+ok/jjEZg/cUMW8EDDWDhu32CfsSqV23ZuDMd\ntLuzVReDLx7x2DmznuuvmhQbZNE2T5Gz09D0trVFApe/ghY2o394XqekdZKu\n6jr4nZkPRXl14Tsb4oE0cf3jB5T35jEAvOIyyiSs27aEeEN4OJGIs/SPo44Y\nwNdTeQAXXR8na5fxUGhn8Fbt+euNbyPjm74Tc0pluYtGIqWTdSJRYmOrPrhV\n1DKq\r\n=ss6N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1a6dd01fef8c367fccebdbdb01245bec0ee260e1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1622"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1622_1594196944358_0.8636866588851098","host":"s3://npm-registry-packages"}},"0.11.8-pre.1627":{"name":"piral-pwa","version":"0.11.8-pre.1627","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1627","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"38b1406b5d2f392935654411e60206450f308049","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1627.tgz","fileCount":25,"integrity":"sha512-+pRDWDFsWIKv0RgWGO4xX7a+DBgY2+6Iy/DUoXzjzLq7o8QmaG6TaGA5EcCBPaE03TWdbjiwhFY2inL8+wOn8A==","signatures":[{"sig":"MEUCIQCrzKPuC0PLeT7lqYTMqPq9tbjanb8CVke1RSxXP4SKkAIgQnE4B957VjJq+Xl4BnjEJ8grwFm8QUQkCWQxGgTTCuM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBdu3CRA9TVsSAnZWagAAC1gP/2v4hoQRJDew3M2w3YNA\n6uBGW11ip2Zken7dYv+d2osBVZ9gKr30Xg7c/h7l397NSkWlv7f4m3+r/ckl\nk+JLdVDriG4VB/0tUQ73ufy4zpz6TrXMDZnnVt79Yc3/R51ydhsno06TWDXp\n1Xexf+2d45akghQ6Rur5QnZrTKzyYRddTmsy9YqFnDVLY0lEIy7Y6hnA82lV\nBOI5Ty3Zq+7ldduj+HlhZ/tYNKaEEZPsldjqB/fNqDVoeUHQ8AHQFFf9ooxK\n395UjlV0eb1Oeta5URgZ51mqSbHvEtFc19HjetMDCKjq375IE/yxfLT9hvoy\nppAssozuIpmASszNYWtwy/nwyU0+4cBcI3D4WLzkmxWz5hPTZZh4Peb7cgXk\n3MYPSszl10zYx7pA6BsN3k6Fw36Lf+rx96sen5GxPjKgXDWVX9tysMpwgjHV\nYgWasvqlfmYU/CTqgfiJ/w6r1ytv5op91w81/SpfoulHk4Dus2c8OJY/LfPv\nXxhL8vQPhLuRMY0Y61tPIu/V9V2zQgIx0wcnl/uCClK3Wq36cf8MM+T3Am9+\njuJEixTDefdPTkUk1dpSDGs0wJ9kBArwLYR3x9O+UIBOLjluEquInI7eqwgl\nU74ALaiG+Z7sFHR4KjxXeb0EXEul8BTTdt2r2d4gyS5lVZEjM9jFRWIwJYE0\nsjP4\r\n=bxJ6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e9219a97ebc4918a34d06ddb3c9e0a8e4288c1bb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1627"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1627_1594219446514_0.18760423208609844","host":"s3://npm-registry-packages"}},"0.11.8-pre.1633":{"name":"piral-pwa","version":"0.11.8-pre.1633","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8-pre.1633","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fae295e32cfc72b11edaebd42e430a79a9796c0a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8-pre.1633.tgz","fileCount":25,"integrity":"sha512-xsV4ur7OAe1R3ofQgSaKvW9uMyPp1ascdSTlSrdTL0UBBrZ+wsS9bDGE8gbmZzbNP4T6WPFIR6Tj2zN12s76sA==","signatures":[{"sig":"MEQCIBiijHgMtHIcD1cyFxI62BUy5ia42kcMBK1xwObqMwAfAiBiT9Wl2AXES0+76apaI1qrXG+eQEeDnJToSxkb5dp4mg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBrTBCRA9TVsSAnZWagAAe84QAJWFIo134JPjtJTLBWr8\nCNaowIEEXWFGJiBhy8f/IVwnS7i+DqZkhMFq6GkseZfFhgeciJ49hMNofoQZ\nERyVKmikt3iSl3JrDmjen/Y8zQP1arHbodi8VuWCLYlnTeL+k/yk75b7Ve5V\nyK+XhXywLZmM3hzP+kA3t4obys0F3xhf6IoPG42e3/pgThDXdKhcCAYybtup\nh3lqv5i4mJmM06EtaHFbzBeZcnk7d9gJv6unWhRvzJGVxjsgafpymv5yp8PY\nhvYdOpb4EgD8hYFYHh3HlIEwhAmVHRd3435ApjEN7O7SryJQLnGm/3ruLgZz\nVAfU9yk4JJpJ11dzm1RHYIrQdZMjJWoKj/dyQL0smFLB/Z52hHO7y8sxoOGX\nuJ6LPubelhtdVqQv7SrVC2DShBeFSY6Qqxim8GW6ZKWwd6JpYH20GX1AdhYJ\nRZjWlur+tJGv33830rIMLbFjWwYKxULWtVT7/hT7MgmZhHWMFwfz2zK6CRUK\newcuIwzLi3emoSbRvo2OjpeCNPb3jO/Q78Mzm0hL+RreWFaaTDJs2P3Z8rL1\nPRNScM13LY8hdIjtS0hyaWtkuSEMzfQ37XHYqa4gPX8VNpi+MIvO4/hxDU7/\ngn4c0fPdsVL7cu7UvkaxFxRs83R1KTs8rl+/jt9ZvDVtUL+BRzsQ2jA5DaqL\nimYF\r\n=GqAe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  extendApi: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7af569dd3ee4bc88bbb53f4231943b5f382791f0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.11.8-pre.1633"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8-pre.1633_1594275009313_0.935409227325813","host":"s3://npm-registry-packages"}},"0.11.8":{"name":"piral-pwa","version":"0.11.8","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.11.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c5ea2d2e0319df7365e8c66ab154180d1e396dad","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.11.8.tgz","fileCount":25,"integrity":"sha512-rIvN0qoGm1KFEnmLco/W5751n8Ax7IxnHcos0lC18X+X5sfod2tkLvuV40FcZAzYMtFJfwYgjHLfC8oz74HtSw==","signatures":[{"sig":"MEYCIQC20xISGYUjNpaucLC5Dqku3nB7wcG2O/mjvHffHhifDAIhANWzK/2f8mvWzTktv6zCAMjDL26fJVUFA78w/W2rSKJV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfByrLCRA9TVsSAnZWagAAqpEQAILSifMEnAabTsbanfkh\n9ofx36NTGKO2V2uvBpGrKzBehNNIPqAhTA/AL1UWvkE6FJP/UoURvxakYYvV\n6mSyJajSZOm1JybWHLvbgs4nCHdbFFxmgnIlfd1eFb2HGDLNWd/D1/hkAZvA\nqiLsvRrxcmVVpGjU8GGvaUyozjuNooaFxgyXCEBjT4OuRrqNGEreBqOJulzm\nfjkfDt/6xdG9yWbQn2fJdSedQSNoaMgdTHcgbh+NqjnUT5TR94ZqYexKrwyP\nejOx1lptHTwdf3T4PChHZ1pcyhQ0wb8Paq1p3lLQp5lErCvh4XApshQOFm6R\nD4TULMjPiWgWPzm3jepmlmI3837mqQSO+Edf/DLxhJ183X3u2AFq2s0GB0xS\nJt7x0NX5IK0T/Z2xe/ilGPIhiQZv4y0c759X5voq2MN9GFu+uTPLULanpiso\ngeAGYzdscUa0xd6lk05WNomZCx4KEXZS5sie0YSlEIWVQ527ByXQbesyTM3Z\nq9KUNHiY9cFo2SfgedqjW9dqDaNyeRzqxMm9mjohGiqpPYa2tPICy5I+iHmP\nndlYgK/72+Bq2BWTzzayUqrxHAYmUj3tp8h+byFNcmm3DZniBYfoXQbGx34/\nN4fpi/8SghwgqvEbCW+SbEclUGMIR3iwx/fhHsJIWwPQWlzWqANlvFX0MS47\nLVjM\r\n=dnH7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"617df77a2d553e455ec66b04936967ff3ce21a47","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.11.8"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^0.9.0 || ^0.10.0 || ^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.11.8_1594305226410_0.825668651327949","host":"s3://npm-registry-packages"}},"1.0.0-pre.1638":{"name":"piral-pwa","version":"1.0.0-pre.1638","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1638","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"99eb96ec0a5f332550f7a752163517350489af52","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1638.tgz","fileCount":25,"integrity":"sha512-TfwW78t7i3CV02dfdQ6DC4Gzr/vCs2zVtRXaowYbZ1bJHsYWitXlL+okiXWPrxNgF2yNCaY8jfPHnKw6cpCCTQ==","signatures":[{"sig":"MEYCIQCWvKCyq8mTGJA86iiIfeFjV3CCPE3JkrbFx3nZB8/wgwIhAPOCeN/m3+N7t0nWNy69nIEzKMTRi3sVqo/Ivktsjebd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB35/CRA9TVsSAnZWagAA+7kP/0KSnxUfnnIIIe/J6ejI\njv0MvB5czyVuxBapDui/khoagDLlxjUeCg9+2HcXCoZ0IK1cDWRK3mVNoE/U\nVxGkKdSI4caKTyLH1tSSdIV2zgg+zPUQhmjkrQVYMKRBGqElm6zEJ6ilfQFV\n+4uu9Q2xFD4VdpBnshx8TZb8Qmbt5YcjlU7CF7pIPTfHgiMez8iRUoyXSzIT\nEn0XkHKKiEtk/tfO10ZuMIDHKsoLFw4JWNPkrR/RhmAqDLNGsmjoi5H/8V3+\n/Dp/xWYuHxwH9NjPddD3dgFYitHXd2JOX9h9xrGsWXsXv1YodMioek+6As3k\nZISUjkbyRep/gkHcoAqxxawupYKCwS0XgHvnZKAyNQu8Y1tCo0brdVSu0Lr2\n1srNMMAr2EYVEdb2PpM8YcDOF+0GQFzWvQXvzvGMJTIQJMS0vvSqrHfKqP7o\nYMY4Y9yU3UwmFsHFu+RJyW0s06NiAybFO5tx8I6aIMBEuRxA+K4LenoSYdWj\n6SkudXUoCXEf2C2dcgIqPpn8Si6ZNUjxTXadE27ASGF7qwtPCTNXtUX+yjyM\nBcsoov0zwP1J/Iaihn7cvqlppbPue3eSdfdEnEBXaS2RMYQm5HItPjLuTc28\nsjMAw0Y+kDFScK2rImx1bNCfd7IenGrGRMx2NdK7trG4JyslaiYrk/JP7scj\n1g1/\r\n=zc3E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"29ed426e3cbe4b59dbc4b9c7c4ddd071a3f8daf8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1638"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1638_1594326655101_0.14600640808497145","host":"s3://npm-registry-packages"}},"1.0.0-pre.1657":{"name":"piral-pwa","version":"1.0.0-pre.1657","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1657","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c92ede7224679708fdac5709a2e3c592ec285b05","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1657.tgz","fileCount":25,"integrity":"sha512-WXvsrBB5GDW3Rgwt+DHSaV/PRl3tWeH7TY7rYpFxG7Nfvod9F3nkOh226oPJAc+B8XZfsvzlyKTTtYvmH3vAZg==","signatures":[{"sig":"MEUCIQDLWXB43RR1qDvY2zhOerPPR7nc1cHGC1fTIYnneNCl8gIgCX8xropUUJucb6H32beN7IsZd2yqsfCZQ0CYg8YqbZ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDWyKCRA9TVsSAnZWagAAwVQP/RjSm04qvC7wKyUyxvT4\nuWrAmQRZomKciCrqqKs+AcK8PFI69RL+bSu/7r+H8RR4re8PyGuUkVzMXgr6\noH1IJ+AwIcQyeb3QhtW/+ZErDsSu636utcLKh5kinAUZgcHBtzLWiTtM8l6n\nBZVLdnlwYN7AcAaKT9VFwz0K/7dERvPK+yleD/v1SuhD9i+6TiUHhh3RZp4U\nuLYjdc8dvICdrkp6RTKL45zfuasGv0CAkS4MJ2yCuVPpIxF39DtYn/gq914K\nikuGjDSAKeCGD60uBlWPxPPdOyE8lfWtfHHs1Xqpe9cq6yKlogn96GkjTe8e\n27boNUim9S8qxR20979xsHsctHOwutylQ5DTEKnT2ykH55YYsVc2XqUDVjg8\ny6upPEr6fvEplXVaw9K/DhLbcgNTSVef0NKicSjw+WDDcLwpGHbPpCp4euxb\niOazjUr+o+LWje79LafCBdI3znk+moTl8QCCOl6y4MjdU4ngSJjAtUu8+a8V\nWiECSp85nNzxjXmJL8ukLYKxVF4efUvxZjWG1ykjw8B8WAusykPdlha2NCI2\nCTgp06U3Oo6iHjplQyyNGF+Kgelnf7R1ax567wTvQ3d4zzkSfXfk7/bnxgRb\n8YIdsifDseyBJdBxnE1ZH7kpoWP7S3Tg0K0y8MTeK6ZsnekOnJeoVFhUkqki\nq6AR\r\n=th5t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"793a4aa660d37f25c1f7eb9951935f23eadca798","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1657"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1657_1594715273554_0.65124972453168","host":"s3://npm-registry-packages"}},"1.0.0-pre.1682":{"name":"piral-pwa","version":"1.0.0-pre.1682","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1682","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d6fd1263c0187f11bd8590efd04e12c218ccf361","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1682.tgz","fileCount":25,"integrity":"sha512-0ghubZIR41YRtMcTl4L3QS+AAGIGvCUpTd8rIT6YKLDNRCZbPQkU5f6jutzpO0lVII1BHzpob0MHKX2GGUHz3w==","signatures":[{"sig":"MEYCIQDZBFSTjfdVarcf5wKhMhHTzRW2Oe87mY1ErEzC7RcQEwIhAMe2gUmsXmWLUy/uxhAeGEproc/t0YEBcPv2XJgjx320","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEHacCRA9TVsSAnZWagAAP0wP/0cYJeDNWR60hWadirpz\nHiGwo6J/w0N5sUw3nppa1pc9+4+4h22klN0TzomPU/SZtCpmLLtII1JFkDMQ\nHXVqlGCS4jsWK9NYQMQ8oD95pZIonN0jniqkMD0VPkwMMd0TKzhuVFT1RLaw\nCjQY0Z/LP4BveegJ234BZtd/t1mz/qMBdl/j4Iqp5hk7pCpDSMsawmcD7YZO\nAWYHwnY/L5nB7tQxCC08/8YidmfEzPG8Bn/xBwDhfB5jXCFn+CkuaAjJWvOl\nQeLybgSqE56GPd1T2Ku3hwF40ov4uHkPEO3Acn6B/DpFeZmN5B9ggtta8v/Q\nGkwJmUW5G/++OobYDqCET/X3cqID8vTXUPeNa5MnFSDP3MJnRcCk9AzQNSSU\n2/JMPh5ehpSeZrKipJJ2b9uIEmGQdHkOjbtsQgCp9mFfS5l2SA79348sH2It\n3AzBOypneplSTAFFjdOZLymxd6fqfvsAgatk/WOSLfC5FoTWpYf7Q1nlbYlh\nyt6k8KvdH14agG4ambyWYE46UBcQSJ2FLy8WKvxU/D7atXs4FvfFaieEXLbY\nrfM/Nl9oflvbQfrdV0TWNP5HxEf+wHDulLVdHKWOk2da+G0Kd5XPHjANG31U\n7UpGVUwKIDXF/prdmwbkTvrKg0lTpFSRvwWzNsOId9altGw2lSqEir3XUtwO\nshhe\r\n=piGi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e55c9bc2d54ad7d868b02c0bcdf6f2a939dc8f10","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1682"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1682_1594914459960_0.0113751744330981","host":"s3://npm-registry-packages"}},"1.0.0-pre.1690":{"name":"piral-pwa","version":"1.0.0-pre.1690","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1690","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"458174a79891c8ddb7b76fda1d05dca717cc2b6e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1690.tgz","fileCount":25,"integrity":"sha512-/OrtYgfL2L8vgdCKNdhlo5nAwJGhMYGkHlzuPJOfBys/DXywl7Ie7Kef8keeTj8b8ymKhgRjbEX+TelsgpsQFA==","signatures":[{"sig":"MEYCIQCIMy8TaIkYv68s/fQ22WZX/Zq0oaVIEccOq+mYwST/rAIhAKjYj3iA0x3R1mgB1+CW1OmHeTAHuFNO7geT/aIwCD3n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFVboCRA9TVsSAnZWagAA2cMP/23hoTez+QfvQ9nWmLaq\nNHkeXkLMpQL+Y53tbEJ/WP8N1XpYYbUQWoBVTJluxph18rNQuU4nRjWF5QuO\n2LyClE3G7m2xNoYE4kG/tRCrb1bLDSK9tE8Ac22zWhaslOTyg9vzC1j9bhMX\nt9JaYjjnpVuS3OeKosgNc4xSLu2MfwQW07kTD7Xm5UvoB9jAHK7SkBiIB4bg\nZvIJklOSV/qvrXT5l/V+j4s9kTE/2LqyZgNSg0WLw51jh+wTlveYoQLAXuPg\nuaUOqjsCrXp3tCEgtLeI2U4d+mg//57naNf4cvPY8C1ZTprPAXTFkMYZzECA\nu/UTWM5HlxOOCXAR9PZBrT7rkjvmpyPPRZg5xmzOFYHO5/0uqVJUvXfWGwTj\nGz6H5+3C+3ru0oZpzpJXAcokK2z4P2OfPUBrxfEGZmJ7KDVEZi7SKqs6s6pX\nlLZw9aSK84oUdPjKVNaYB6GIqG5lwRuHF3OLvL6bm7j3p1vzbnSwvUsX14sa\nQE+2PO04E7DjFWXbaNdrsuIO7BYYe5Rf5KdASCC5BrW2BFXw3LrdiKEOXpVM\nuRgr9XtnEBKVCdiuSPmPBCfiCvVq3NaUIjJq9NUAV1adxKZWLT5i2b/uzOBQ\nPmee58mlq125ec6sHCwWzWsth+qPQp9XF24YE7fPehvY9W0LzZTdcCNQuJuX\nsxB3\r\n=g3e/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n> For authors of pilets\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n## Setup and Bootstrapping\n\n> For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n## Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n## Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"19e33db4fe045aaed5466fd12a868c1e5daf6ef5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1690"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1690_1595234024072_0.6132096990936398","host":"s3://npm-registry-packages"}},"1.0.0-pre.1699":{"name":"piral-pwa","version":"1.0.0-pre.1699","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1699","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"82cf086f96632b80dabb66e88f605045cf537665","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1699.tgz","fileCount":25,"integrity":"sha512-ByqM04deQi8O1QWp46MF02WXGLnjj063CygN38RO4CYXCA8yKUlZWvMeZXniFNzqKWkqb2+FaRpgvNUUoQHHcg==","signatures":[{"sig":"MEUCIQC5BXhpVm0CHeui8gznjVWxbaQlpzE7jBmLSDwvN6f/mAIgdPYUrZlyubc2uxv8okau0VcD4i5qcqtWbMZJstQRIcE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIKpQCRA9TVsSAnZWagAAIvYP/1kdpWyY2w0AHAXVjrn/\n1lM1lj722nCA+rZ1LuDCkpjjbYPBNXkntQ956JvoyEMJQEwHabx9pCHUtXxB\nFBejdn+SYhq2ieKAFACuPMwmnC+pOHmcSipgZTIBxhoTbkoNYr8nd8k8AiJz\nr95EO6j1UcQz/RxUHliK7b2AjyQayWpTduL0rWjbyorML/Eal3CgMO8NFbWN\nBIYZ7+QniWj61LaEE04JoovCaWexroGlTjQb+hTtjYRrP1FjTnMLJkBbX329\nBVKHuIzAx57bvYqbafTVBxCtmYO4d+Bpze1ynQADPG5iN+3Im1dt5fD9+emw\nD0C6wC2Wg9CdTF9C2NSC396mkQAr1cMVVVO1aDazmr7taNTAR15Zroa9Snrl\nJBMudBvULI+d3ZU4kl467d2zs8CRIC+f6Q4bMRzOTMhk2GFau1dOpJ6xM1dT\nkKOyzwSMITbWxBphtFb+Y3/UbIzTIbAyJuJSVZsXohwoNyuS6wflCRqfGJY3\nELSuwYi6HgjpblE5CuZ0zpK+gMe6eHkwl46KafzHQMO9j9FaMaf8fPZZFP6p\nI6nn/moJrj6hP7YI7OZzZtg7p3IDjHNxu/35TpKYdq7YO76o5VhhaDZNEQiQ\niYd+4JsUzjsfRjJ/2SYufyEdW5VXBPbbwwjTblF6Ett70QYeBTZETHCzKjJI\nvWxz\r\n=jah0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"317680d30bf226a6c54a4e05f9420fe666c090df","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1699"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1699_1595976272190_0.9354191088131436","host":"s3://npm-registry-packages"}},"1.0.0-pre.1730":{"name":"piral-pwa","version":"1.0.0-pre.1730","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1730","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"581741831e57a8bdd616fef5b830c12abeeecdf7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1730.tgz","fileCount":25,"integrity":"sha512-Mdi1mpGtLl8ZxNAKXl0A0GaBCYg5bIz+hMmlkSh0Onlq3weOIS86ypp410cfZ4LTLBh4YxmNlmf3742Twbmzog==","signatures":[{"sig":"MEUCICO9Y3TBPQkCsJoPJQNNsjV/CgkOvaTyLDYaqaBgE6zgAiEAxNEWx212immEvfrqCTiWjO596tNhwr+hUs1IFBedg3U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLB8wCRA9TVsSAnZWagAALnMP/juHqBSLOWb4+XXNVQ7n\nkUWK4WMK/WD6EWsVbthkvFACMzNGU5u6KXxFkUmvuQeJienQ8NPT40/AwTCd\n+46VjyKWoFcl5vGyy2NqhS8xPP8v/aFrHltkF6fJ8lTmmIZzx5Owyy/xHJHR\nVaKm6dG87zjL5psBizC6Pc/kaUvkKFoPZJw/Z5nl+mT0RpYIb/Lam7uf0fo7\n8BObjKr9OHgol/7ym1LsAbzaINJqDEQ7Fh4n/qy959fMGAAqIM6rX/43PP4i\nHalhIwE7oRgksDJ0qRHNszl/uXAchrHhEDcCT8ExhoTuRSrx8sJFqce8MJsN\nZ70wJP6FxQX5JBBYO8MhVrOVfx9qOeifRW0ZQBp65OjDgF81dFN/mzbdNXCA\n69supLJKWcCRTqikXC1JxEF9NkDJh2OVqPISs91V1cmkAWFcUOZBVtZ5LzTQ\nW5SjfxVYIrkRBZujL4hmI5kAtgPqGpiH+A0aYyn6n2CVMPb0u04VV55g8Va4\nbyMnXCOaMDkOo3VWOgjo33XHNhwUd5ncJXxFzHaSdoHImD5QX/OyHlHUte5M\nCTk7u3ct9GR+CzuN3fEoI1Te4gcy8xIlhZVvXavnGAEQjhfVOd0vQ+/jdtuW\nGqvVLizORa8sILOP7D7vJ00Ji4uLqZkKb4BnME1IO2iMGZSGSUdM0i7E/ebv\nsEW+\r\n=m9KB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d4442f3ee3771df77b8904ba5c0ebf8c85b9a9d8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1730"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1730_1596727088327_0.21472101719474113","host":"s3://npm-registry-packages"}},"1.0.0-pre.1746":{"name":"piral-pwa","version":"1.0.0-pre.1746","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1746","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c83b72efa37bde2e6a675e66d669ba9109d5ac37","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1746.tgz","fileCount":25,"integrity":"sha512-ILKzd22UfadSwZovv0ovs5eQCD4BuRzvkOESHFEyBAQSEWaQa8uny1M1zZcqcnWrPymM9w1aa0mAZGIay7OdAQ==","signatures":[{"sig":"MEQCIAOlZ69soqo6nJsBQy09HrHNLDAyx/LF1H0hq96TRVp3AiBmesfCx9anrdMvdMDaHsXsRzI6XAchpQ+UDGSfyppFNA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTh5QCRA9TVsSAnZWagAACMEQAINMTOw9qqXIH42RIMl6\nYZEk/t+W8Gx7D/gcgySNDUaDgzYN/Mkkkh7HYGUhxMXF0fRCvJFJoHnMmhDR\ndFU326w/7ilg5miykxYGTX1W7LsW3lIGvMnG5c2haU1DG0+O5ucJRWdg5dRw\nCqCesopMj+6bL/f+MiAy+YoDVEUKkGN+PRB8Vtz/Y2VUH3EkWYJ/CB8BR5in\nfpvJtdbxyfPsbXN9wRFJKljuyH3nPTdgqvrKBzy6XS8B421bFsiqAqVFn89Y\nO5xahIF3The+MVeV9uVLAmEgpFDE9uRAm/O6JLSjiCBczK/RY7W4Rxjo5FLj\njdJVZLMUE4+JNuqmngyRBoqnw2y0ldD+2Eu10xQGtg9+LeZapI6w+K1Iisxi\nRKYxheUd2FtZK/TWlUd7+TgxM57UwTCoHVYQPqGsWPbhQM6LLToWvdkvUgfF\nORwkwDp7aydaUwIWMre51fg+vcZjgk69VyUdbLzcSkRBSRXVn4ZPUX3Mij30\nFXI1JdMcIItQ559eHk5hWz9DL5X3AxFiLftyhSCNNp0BX6mcBcz9Zb5VsMT/\nhX/Hpt5AiUh6/7/lGJA3pxxBhujSUkQll+p1Ey8/jLrB4Iz249naJQIXPwaQ\nmlDXaVAm0C8jm2Jak/rWXfD1bq8aZWZ2RzF6PtyFTxuJsZZVCJdllCwXkINi\n0clS\r\n=9Txf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"afcd06699b9ef8e041ff984d6fa6c5c94bb33638","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1746"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1746_1598955087622_0.5420886215337766","host":"s3://npm-registry-packages"}},"0.12.0-pre.1747":{"name":"piral-pwa","version":"0.12.0-pre.1747","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.0-pre.1747","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"94e2dfd5625487f96f88583c19d1ff2a694d52e0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.0-pre.1747.tgz","fileCount":25,"integrity":"sha512-0AxaBmKzBpfg8Z7CKyyTVXxzCb42I/FQgxhSTDE27jSQmmQIqQ+70N8Chcr+lYe9Jn708FW/cw3V2bcu81fOqg==","signatures":[{"sig":"MEUCIQCcXf1ui7k3UzfdCgE1OIPqfhqh4PpCmnKtTkU1lWaIBgIgL9MI1jH1o8Bb5CiPiBjU1uaDV59kdX4MbiZZzpk4VGM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUrgMCRA9TVsSAnZWagAALRwQAKFlbz7+DHvkLZIs0z59\nE1TpLob9TxJ1E3DXeNYZB0/o/zoAkfhkDv/GdBHsqFmaS8IFqYSlpYAL6i/Z\nGSMlTVFG3a0VK67yiXWgVarSZyjHhn5MerZ29gxXf1a5KySKnCnO2o+yIEea\nfDvEjO6N3GqnG/8WbrsPIs+PDrTSyQanfw/68H5mQn9v3TRASKeWStFLqrUY\njY6rkvRdOYysvj4LsAa3vSoztKZOCKJk6/UY8DVKVl9zsnA3NSTm9Ua8cbUh\nLkFlnZxFquvU7CYA9OQC6AmsCQJo3dJb2TJevGV3kxhDIsWHtVZurtOcEwP+\n30wonUH+zJ0AN3axWlcDgvZ2Bq4nx6cYIB9+gHQ92ieTiXVAFqw0kupvSURD\n8tL5BETpr0vGDKsSMv4SbUkN0g7pwqTyS2MRTsWBTXNBTl8dvlGR935R6qIR\nUhjSDxZxYl5bf03eZKG+6A56HGWQuzzyy0Xd0ob6pTSdr10LHZjC96D+BAec\nAQuLk4rPVGfcTH3j2D0P8+FkwFvveWg9SzZg17ju2aK+biDVZfsBaOkrM2D7\nv8cZONSuW6hmUNj+XONvdqekDNnCu0OkNjgU7JTWs0RSdmRfkLFB1f/iuESB\nSW4TibLvFo5EOCVPYLMXu7A5tk+Rn4peP+DaHIhohz6RhPL/i7t44bbvJP6F\ntYOj\r\n=CPeV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"fe6d8ac1e84c1760cb54355f8fc627bda8625ef0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.0-pre.1747"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.0-pre.1747_1599256588471_0.3467050540059775","host":"s3://npm-registry-packages"}},"0.12.0-pre.1748":{"name":"piral-pwa","version":"0.12.0-pre.1748","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.0-pre.1748","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1e2b6f170085270e3baa2a824c43d614bed98cd5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.0-pre.1748.tgz","fileCount":25,"integrity":"sha512-IsvoKPFxIkOQXXp2jthtsRal3XcrYRBdj3/BtLqC0qhni/VvwAQDuLYLY7nmfu0nylsElXy0G/u0hhuRb6tZIQ==","signatures":[{"sig":"MEYCIQCP+ip14j8wrva+1nnN0wrE5psWLe9u8S67u/F/k9awmwIhAKZ38lyHcvvH1/V5yHeecm5cfvxeWer1RHP9om5x/vUg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVriiCRA9TVsSAnZWagAAUykP/3KWgE7f26nM4vaEJQ91\nCYetlHGdjbXhi3CqOTivGbM1jEYI2fWzyt5aHIrB7zqrEGQgm9d8BMUUHg+z\ndWGq1TKHBo9EC+e3tts//tS1LnTdqGTCoWAeu/drq5MVVVRQIt0NrEYfz8ol\nve7KBdZMCzIklmxMgIsefV19Uee9ZAP00tYwvOCyHAcq6TjXxaJqz+tDTvbu\nX+X2JEj/1DmgRgoGVJpkwcr7JG/OmoDPCUBXQ8ckfRAvMULd0+wkdEJRtJA1\nQDPw/hCe83h1z2DkbA5Dd7vDU8wVSnzCUOiwjXzot/M7UJ9lVQntjoAXnas+\nlrZr7PpEogZkAL11hx+b+ydp3C9HTGPOqCcTYq1uY6CYWVJt3zRO0aj3oPOK\nMY66ppTMOWg5Aif/vUILo3+zksr9MPype2X0K3nk+kA4Fq/A5SO3hsUteSXy\nuE0j6sB/FGtRtho2KF7YIAxidWasaO6oOWz3RFOwUcBsXlEkOJBx4XGKF4Oz\n5Aq550nLSZDny39oHzz9kFVopEnLRn8GbbPNgPcxIJo/+/qCyQRwAtFdMe6N\n4IgClexAyn+k8X5jWCDeAc7KbASx8tQM95GMoemEcB7Tr39wzq1Sqdn3mASz\neDPt9APZkP1xlaLND5hU4VlQIliu7zsRKA7U4beipgME0048gjgVriWYbDE0\nKR8H\r\n=F7nv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d34d6d2ba17aacef87ae945fbefcb75f923562af","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.0-pre.1748"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.0-pre.1748_1599518882325_0.6015774938722134","host":"s3://npm-registry-packages"}},"0.12.0-pre.1750":{"name":"piral-pwa","version":"0.12.0-pre.1750","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.0-pre.1750","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a702238c2169e1df6487192be18e12616835cc22","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.0-pre.1750.tgz","fileCount":25,"integrity":"sha512-HnHM4NvE8syyhQJL9CIvA9NNvGE2kQdp4w83FjQAICMNiyftJDYol156BP1QkOnoLORuiy68OsMcwHKbXP+Rxw==","signatures":[{"sig":"MEUCIQCjZ90odZ4B+Ihm1oUbKXVDn6KHOCB23tUhMpdS9TbEIwIgEblWpDHeYrdv2vIWdOTZmTMzv9hK7EuPnG4qsTNeyq4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV1i2CRA9TVsSAnZWagAAT6kQAJ3BA6kLLiE9vLIghIUf\n87T/wi9OBuLbZw+HsfpnfVzOlYmpRNY7zJezl3+JnWjxW3g06bFOZhma83wI\nr1wibhIqdaYf1BPM18SwNikTxSsuzJ9Q1/PmdrevxGjL1WBV+rw41Zkln17U\naO9CplnFWKHBlX7VKfM83jokJgsspO/+oGso3mFAVByDxulPkVbfc5r5xRLP\n3sahDy/WoQndFc1lHR3hKNOISfYJBwlNd9YCAU+22Jnzfz+twn55aNWSXcFj\n/f6UFR4cG/u54OJ1t3qATbPnHnm9/z0ZVcD/k6OZzymuo8ql60VmYwuL9b8x\npm/KkmIkrkgcyJAYCEQTUQTrwnP4Qi0unMN6v7rQMzFAnAWpebKsF7ywYAF3\nq1tWcL3tx0GsXfVVfzq/vEOaWT7MnfYFA5t5BuNst2R6GLjUwT3a4SM1VcxO\nGvXWHEU5DFSHOOBYhLp2sFn6nbqm1gCcEPAGIXYos5eQo4Ha8g1+XuLt3Xwf\n0N58DKgzqhcVzK1nPyagfs80a9YUBWQsdcbyv132D2CmaZCSRHEdPjGN5hEc\nRoB9Un6KBsisD7OlDcgg/7c0nCEmqioj9uwLFDeHW5x1xRsTd1/mdkhkj3qo\n5fsKGtXkYeU7h4n37w/IVJ+k11oGR7fDdMiCcGwssc6WNS3cPEfFzYXQvIw1\n8AyQ\r\n=i4io\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a72888f51ad776b30e4b7fbf86da6833a5f669fa","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.0-pre.1750"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.0-pre.1750_1599559862157_0.3426443160465926","host":"s3://npm-registry-packages"}},"0.12.0-pre.1754":{"name":"piral-pwa","version":"0.12.0-pre.1754","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.0-pre.1754","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fbbb768f2d156dfc807bf11d3c31d6cecb32c8a1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.0-pre.1754.tgz","fileCount":25,"integrity":"sha512-wDzhwKyXpI37+djNfoXiRWE7mMcdgo7lcJ6jJeDhIr7fNe/L8+0nlRrC9oF/BDRK4o3HjTv6Zh6zTWHNl3p2IQ==","signatures":[{"sig":"MEUCIDWkrjdcPiraU8BnMs0QQWN8mGnV1AiWQArmD2/ziK48AiEAtOqom6gsQrJxLFBM2HJA5YRiwASpGm7EFJQDgXrrRcM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV9soCRA9TVsSAnZWagAATc4P/jUQ6oMZtR8edU++bRKj\nydksbwB1XeRnwzeMwvkYI3/pNBLTatWeYKgXkWLqXP835XnssU/+tdKn0HHP\njr8zmOn+uSnW5z2GSTv/bY1uc2GSLODp3zlZC2Sr4GK/m3ezdZCIiSQViIr3\nDK8vkh+lHoHQhjnv4khEF5Ddgfhe2mgmlNN0C9nhWnrdW5EQy0KVXjChMqzu\n1QZ613Zkf/6Xc9UxNQWPYmbUbzRTZ2QWcMMZTa3TGJ5+EKS6TQFsakol89pu\nz2u7lsRTtRyb2QpwbW+7YSnRCIuWpKRGvVVmx93qSjBP8f6daVk/SD2eLq3x\nXX3y7Mc+qbddDQp0rgfpkDgrKHwKpkCJsKeVO6J6NDXHKaqUKYLaMFu2t0UA\nvuwJBAU+Geh/oSbNzacOQOb60kb/w2OomkL90AekmdGyN6sbfZufucBK1t4W\nuiswrcTGUy5vwZAPK3uZ07RJeZKK/qGpyxSJr7oKwphK2hrMBl8bVs6GqlRa\ngS2XoCkBUfG/X9Lxr4DsSjMlhOyS2UQ3MYYleYpo6r8DaaRNgqFcwOBr2rTs\n1GWtNO9Jlheopb84Mqnr1vUXZIEI1dxaG2tp1p0P8zP59MJ7Qz1qemB+G3ru\nj0i3R3W2gpMFZ/5aUPH9L8C1yBB0Epoyj7Gqfpitu8lbWttNyZuMy8j205z1\nrBwn\r\n=znsa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7ed660c31b0ff8fbd83beca98c947f159417d27e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.0-pre.1754"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.0-pre.1754_1599593256090_0.8732831839596413","host":"s3://npm-registry-packages"}},"0.12.0":{"name":"piral-pwa","version":"0.12.0","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8f66a52bc58be0b21e3164947fc461fdeb0c084a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.0.tgz","fileCount":25,"integrity":"sha512-LKojPeVlwmZ8EBjNj64V/ZKjQarvObeXPeEGG0Ua53tho3e9x0fgc6/QySoj3EdZaGfXj4y5bvwQGng2iIbouw==","signatures":[{"sig":"MEYCIQCYdQzH+RrdIvPcVXidzr3LMGXGmRexG3WfYd+OGJcUWQIhALtZJKydcATkUpFK3vdKKy4wAEwnw4ev33AOdOEomXQ9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48911,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWJe9CRA9TVsSAnZWagAAWNcP/AmLxuA4MCJpVnzCA45V\nbVthF/ads+x8Wb8T10An51alXkMVA90T7BkaUJHkC9UBrasEbTnBc9iyrvS2\nJE+KvuQgrk31j55T8MC0NOZiNW1rJ4M1wWV20Pxv6qLQKOathQrxLrsyUKKw\nXO6lcgrPjlftbDgs7YYJEWaorGVANVGRGez0EydpSIAOKnaoel1V5voaft9z\nXUxn5Hsi0tM6QcBzEhtvu0dXzUR+bv/HgaRTkMXUoSwI0nFFidBt++lGWCZb\nTsOfFlSEbCmd5h2lM92/s+XupRqA5/+cKle2CVehzEGWUbuoYjqxpxoQIB0c\n222hOmNAHHFnQ8m0rincvkaTSxwr1b9n3UlTZFmKU9DqRbDuuMqWNoFp2IBL\nsZCLBCPIETAzCrvqMPSsdT6ZCmCGsTAVizdWRCRUja1BclL+cSyQMXT984uu\nhkgP8hiePXy0GrsUORAsYdMCaKsDodi3sa9eedQmCEqVF/LLij/W4DFL+wuc\nAV7KXZBX7c+eufjNZD4U8qXg+qTCuwkpbkgQrJtK7Y8uFqyeDyLxxFPpx+/b\ny+u1tQura98NgkavJEojHYq8j4uuM+evoDflv6QfZG9aW5Thr8dxvtDKhHm7\npMlF38tcQ7mr2ffvDAPytNs/CQ3ZjQ/EBodtjTn0d13OHYHnTr/ToFljxjc/\nh/e7\r\n=s4AG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"2e08688de476cf93fc4b63d1cbad4a27230cf6fc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.20.2/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.0"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.0_1599641532686_0.5560777543944904","host":"s3://npm-registry-packages"}},"0.12.1-pre.1768":{"name":"piral-pwa","version":"0.12.1-pre.1768","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.1-pre.1768","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2ec4d34a4504296553e3cdbafc87de1e2df20a76","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.1-pre.1768.tgz","fileCount":25,"integrity":"sha512-CRyEv9pr2EsoDlRCpd20CVAPfhRwti9ALIisAgXXHitY9BkShI//PhsdH5OvKFGcigNIS6zLV1NiYo8Z9MLE1g==","signatures":[{"sig":"MEYCIQDmv4R6B0h8TafHlrZ099cNGLQTnERK1YKql04JLP/OCwIhAOvGOujQc+mo0bIXq2d+SbpGNnDuxsmteXEL2A0UQCiF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYiQbCRA9TVsSAnZWagAAovMQAJCXEj5MWSrzGKUVFIUL\n5ocDE3Zo12g9aVwsRHgwV57m9qFChKXzdfq1Z+FWa3rV6jmZFCWcdKOMcmek\nc6mVhxIcuKKpiJ2daKdbe3rjBmLmVh2enSUDOqnQmD2jrBBQ6/2gzFbe5qIi\n0bSm5vZuucBHUCqowbus3XE4STrLeYIIl8eN4wdd815SCPe+ne0qcx6dz1xw\nILhtlSHwB1GvpQMRGHqWcPs5hJ+dH5nP0eANfhgppLiHZWaMza1ytW+HBcT8\nB5XJ/28ajYh8auSWDf/dS7XOoeMVG4dQ8MGw4ziznbF6BTXGmurKiLRTPxym\nKokqJVa2w2n+hy6PO+P3NCNbQZryHYL3PcH4OZIMXJnbR4EJ3HQjzjQsCJ9G\nnVqCbJ0covxaQtfLGfKgNUuGyqKov5gHJeCcvc2+HGD6PbViCfmlJkjROHQB\nyMF+Q9CPnK7Dk8VNYemSXc+sqOXodW5Bv+t5fasa+zPdqwTJ7pFdsj3Oiq4V\nRvy2jy9UODPtzptef9NtkcdiDjI4tmYd78yGnTCihNX5RD0cIWUdsIFxGFKe\nC1x6xCAfxlSWTp2hEYLQMcWSxl2Cth3GNj1mToLPAZ0/MXJj5SVVVe0OaMnk\nj5bNnOijx0g6GCS+KurN6Y8DAIFovJ5V0fLWreowUfYljmWkperGHDUmeB85\nct5c\r\n=0C0z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b3e94d1fc6a541a787506082f6fc9d0b8a89c3f5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.1-pre.1768"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.1-pre.1768_1600267291188_0.8486942614318311","host":"s3://npm-registry-packages"}},"0.12.1-pre.1770":{"name":"piral-pwa","version":"0.12.1-pre.1770","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.1-pre.1770","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a981421f401390867f699a7e33395e74d6ba4790","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.1-pre.1770.tgz","fileCount":25,"integrity":"sha512-uBGI/5BMncepXtzz/UU4qg8lX0H4JubNvRy6NmDV5aVAHMFcvohkhyMbxxWgFCu0RED5HrHuDmVWpg27a5iAtA==","signatures":[{"sig":"MEUCIQD0WBFUn9D/2KXRBKKIhOWko+VAKObXUWBbi0bItKUcfwIgFRLEI8z4uUaI6f8YToOkk57a3JvYaotAMLnW2k2Yc1o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYjGQCRA9TVsSAnZWagAAcF0P/3xSxUg6L09c1wHxsfJH\nrHNkxj7Mh2jFO2LFd4MlLfgA9suAsUyrtGp2KsOjsUIPQPoRjJqZlHIno+W6\nOnXCjxl/MbDPjRcGRELUm7kdV3fNp15yKRI1yvV91YKpQBUK9bv3ipSnCPrb\n+sHuoI2UwEauWgOuzNjDjin7T9LpH1IE+Eut+WkAqEYdnGhLut23p4zBj/hq\nfddD5yqBshlzK1rXC+at50LGVJf2dTMg9N7KhiIwtD6X7mLHldhqpOaPQTU9\nWS7UjWDmke58PvRqpQ6YJNmUGcB9rNeJFSva2LTF8lwEbzvcKSfM04VevKT4\n4SspQA5LAmMrht8DpOpB+BRBkE2MuF3Md4StgGe8AtkXxNlko7B6Rs75iti7\nLKzPxGZSNu+CkZbT0A+xx9fxDDrOoj4144FIL/Zy9k2GecdwbFgqwghYsB39\nbegk2OFaCmDKGPErBQ1NSF800pYfWRqDktN3DC0ga1wfkeNVvfi3A0kwJh+0\n20cZdxpiRCehFQDYHXh1jDmDX/22HEksqpPdvOVJOSLPJCipc5anHolAQD9T\nsRJ0gKuNLVxc/iNVV7lG+ENvx1hTIcKOENEfA3FNrVvk/fGSzOfbmx+IVLqi\n0w7cFEId4e53x+y2pEdzpG0Uli5uY+fvnzAsKSr0f60GCLafZgRkFruzriv6\nB6bW\r\n=4gvj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b46d5e5464e032fa25c1b9bbebb83d1856188b9e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.1-pre.1770"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.1-pre.1770_1600270735811_0.5211087803810353","host":"s3://npm-registry-packages"}},"0.12.1":{"name":"piral-pwa","version":"0.12.1","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"89cba6e625c5ef24e946f3d6fb22e02a360f39d9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.1.tgz","fileCount":25,"integrity":"sha512-lvNfc7RqO6xHOSZPeZYoif6YxDoWOJuWIkHlay8v9myO7J7/DNc0QeVS0RkFzFLQhXvj2L+oe3gXb2s4X/674A==","signatures":[{"sig":"MEYCIQCIhi3nQb5s5qJyydOT+TMzBDs7rYZ3UXBLOMFKak4WxQIhAM9lTWava2Arf0/Cg7LZh2Y/qPcGv4e6HMXEVpb8qGsc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYxq+CRA9TVsSAnZWagAASPgQAIimHOT9pme4dRLcVWn5\n/tgyVb3DjmXq7EdELkTLnuL+mJe9Ig18m/nh8PproEc12hEmMvZDQiYkSP8I\nBBs9KKObnfQV0JJXpZJrH+a1RR9mNngKtTuekuplI4n30dUGh7y0qoMb9pjG\n/OQa3Royz6gqDYnr2StjMnIo3RVCwaIHAnZ9DK+PG4Ew8FPQmLpHEIADWYoJ\nmtXNBivmlweNeY5JdhpSbR6dLLch1jSljuK7ItDUXPgt5xDRTtT0Z3n/BDP1\noijr7WLZZ0uby7K6YE4tU3mLyYuIjh63DGFek9ki/6rgrK7hMKa7A3/lgYP/\nbcDqia/QwU6EidvNXCFFLFoRbERVAL7kIwW+keFtSbxnQjByZS/eAg2wV9NY\nGZ4+kmFjRcOWnQRxRwszStWYajb38LK+dGCcFg1SHeC/D0MfvTVej4SFC4C1\nzDtNPHB5gSA5RdiIheojp3NUqKgHeXz6QjR1wdJFdLTqXpdeVNrDGwNitMmg\nAO7VCZDw8HlYTEXcmCIiAAlGEY5jdfg7eHE4RsVxrEkXgUDR6BPmjNN5ra0E\nliL4CH808OvZUG1IFcAhleQUkH8nPcTpbMemrzABLiNqxwtNZcwtqzU2loFC\nE0wFaIHoRa0bUFLV+Cqm3lv5XOBMGibSPmGPNNKzoglzornJ0NWa6HqTjgTm\npVDh\r\n=1CVx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"e49eae16f72d7a735f922d47b64247c71c2a0ed6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.1"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.1_1600330429650_0.8247819358132737","host":"s3://npm-registry-packages"}},"1.0.0-pre.1779":{"name":"piral-pwa","version":"1.0.0-pre.1779","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1779","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0cfc1fafb967b7dcedcbac08367f31c5c0e250c4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1779.tgz","fileCount":25,"integrity":"sha512-nL2ViOyuWsBBY+JxjbdcOfm629UEEmkbx0PKqkgAu7X1I5CKYj4hEgxCFS9RLtaUtMEH0mJ3IVSXK53dNVXKJQ==","signatures":[{"sig":"MEUCIQCCO7oG8jsC2CHbzZRU9yeuCzgih1PiKngskUXpa3CU9wIgUKy5cEbQe7oIuJ4qP92cFrMjHcqCo0VF6zo6/6c6Uxw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaJfiCRA9TVsSAnZWagAAM5YP/2VzOiDa2Lz03HngtL5R\nKLAAv9d11gl9yl4gDNQpgaOQXPXjEd4djwEW+4BrEvT97YS9F92L2GPMzfu4\ne1hQuoUV0PY5s5b93SuOGqe5PdFaiH1bf17IEkUIPFku9f8c6ti0qqxhjwSD\nWod3pDplJQSiOTDo8guRcUIvtwDn9f8BwTlIGoEW2A2sMzn7Z/J/KRH7OBBe\nXsxGQyiLXbpLNS8T22p3wApWnC1IpZQxVEvV+hEOqpLaTN84+vBLivTTcuLv\n7sO8peY+PXffJsuebR9ScBB/3HJ2CgT78qx3LTtoxill42p5dAhArzUI7Fj/\naSypsEKRIBHjU0kusXe0HmKbDcJ71n2joyBb8cauLQZT2YHSHq+lbkJhQ2IT\nLNgBOQknd8zl0LzutRwuGdExj8ZhdzvJarES9qZzLmpkBWE/xWO9OnNrIGM3\nOhYQgLHuzBe+Zy4r1hdtlnhX2qftwhL9liwnlTkavpTrHefsHe4wJmSo7nTF\n/sgYMmA4XLQUBsGDX4Fhpp7x9lqPlctaZCN5brMBUgeA52Gr6sjNKxLCyPIP\nPv4vGlGz2cFpnrceLlhmFvDqhEZ1z6LyUpvrxauEc9p9LPy69r+7Puj9XA20\ndLjuLMkgCL2kvFzRNZUoYvmu57egzpph9dTjKF6bFdt60OqU4gY26IkNAhb+\n962A\r\n=XmdG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a0580aa5ef2345a2091295bff1244676cd4e1f5a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1779"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1779_1600690145604_0.8572432133701111","host":"s3://npm-registry-packages"}},"0.12.2-pre.1793":{"name":"piral-pwa","version":"0.12.2-pre.1793","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.2-pre.1793","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8c2f667c5de31bcd6f816f5cae8f896a9329f2a0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.2-pre.1793.tgz","fileCount":25,"integrity":"sha512-fH7QlsnB30X7yd+t2zI77sNoGX0UsqXSVeuh7BRERlqgu6NSd9g3WBRlQnwNubUvQpCvCa6uz05w67E28DFGfQ==","signatures":[{"sig":"MEUCIDZsz6YBOamsifVhL7Gk7Bant7T+JJEpVBvKvjLzQfNDAiEAuyf/CfqCWwWO/RQbkFil/FQImdcV59DkzSqDRndNf+s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfboo7CRA9TVsSAnZWagAAmhoP/0iUDIEmHChiNYVxK6P4\n+f0kZhy0+h4dcLgqltka9TUgrOxqqo5RmgPf5d6o5S0ml47lxTooKVie8XUy\nnCDH0EM3Qhaa9x7C7e0SMaP0khLi36cNKynowjf9mLzI8F/MdTV7ELtn2att\nASC8zyj2WNn0qoZDnpqhZ6rtZ39ikiektq+bJNDw5A1aUti967hFRYwHaoAJ\nYNVJoXu3eRLKkr1HkgdpvDTI+WV8SzaiP2wHfc4+9MYdYSdC5BpNrac26XfV\nqNVT0zOBL/5jw1yhAvMrtZ979CgREN/BqfzVMEqwzx/MaSnMqmx2+FcQ/ODT\nUP6Q6w+xoApLbSOCTe+dQ48KXXSMINC5J/r3rUTrmS5q3NlrLAeURWzFVmsz\n0mP2LJvEqHg+gRDYgtXVupqQKykGvkrJQndMrGDWObLMRZjoMBsOrluV5k/b\nmCzb1/iQBJilQviiYgOHJFMjg5Op/2QPHRRYxsrBQDKofpTncazLbJ6o7LNZ\ngYu5bQm28orlc8roJnuL0EYwSTFBbZdMOxx/iB5/b7mi7Iy6WrbqMPS3QmQo\nwiWIiTbAElOxj4RoVoZ90uLeItOlk636U4RBUOAcK6FvrFY5Qp1VMa9aSZjV\nPoKFa/Erb6A4Tm2NtvH+qun5PAt2TsxLHk48FkNwF5eF4TXxN9CUtzRr31h8\neNUZ\r\n=T2Nf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a50f6184311434b296b084c47b8eb844d8a47c00","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.2-pre.1793"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.2-pre.1793_1601079867384_0.1137336232231787","host":"s3://npm-registry-packages"}},"0.12.2-pre.1794":{"name":"piral-pwa","version":"0.12.2-pre.1794","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.2-pre.1794","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d7d425a5b3cf39a8d76267456f0c8797097183ff","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.2-pre.1794.tgz","fileCount":25,"integrity":"sha512-i2oe9Fsg6E68DslH7togtTgy+toDvqv2XGcR+sOjFCJFmv6X/7vFDmeGAUxwi93Pb4tY7NLgNUdpp0dj9xPA7g==","signatures":[{"sig":"MEQCIHXLE9jY2bbK91VpamMuiaVc5Limjj0rVlrfXftWEEtcAiB+LqJ69k612Zxl9zR2JHEoOjF9sQha7niE6c57O1Bp5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbzcyCRA9TVsSAnZWagAAhVwQAIzB/ESCzZV6LJ+7gIZE\nhDG7U9LQhQWTXazZYxPDJGGC0Jw9f08y12pbZj+HrLX/quytNH9XcIpoTTPj\n37H5nfX5rUqw00JlbzB0szZX30haV8ouiT0ZxrGgPyTg+rRn06EaETBFz/rJ\ndr82+d+LAi8TBmpJ5r+MpRdvk+6TdZfo/VPJSaTXJdOmE8mPAdyPsT+VQECU\ndZxLhLxWOoWB9i8DV2FdR/CRY3oY+HcT29mObSDs2Trg/Eka70zKgQus6XEt\ng/ghXpxGwDOtW7Sp4fPMoZ1tn1Ltg+J149wPzzMFMen1uB1f/zJTm83qvzjK\n6+jVkbU+/CJvGUylGOPID7FlMWraUNgz5Tat9XHAzmXIPhSwrmoT69XNlncI\na7a1wrSM3XVHpbHYdkEWz8cT08aNwVqGwytlz7cbL8gMHh1Jha1P9TO0R+P8\nZvLqwOGbUBepfIcLscuxi8rFrZVvmpCWwNbnLqAmm0hGjV/dOn/vpRVYJD4P\nAmWO2IX6a1j1iK9VQs7IFwUJFDL+dP5O48qtqtwm0O5Pvy4bZG8ZVikPO2EM\nH58GqyIUHYpRpFQIp9aSPs8akmL8fbGqbqngSsxCpG5PhyXSsSMx7JUJKIo1\nWbmMue3Yc6W8+ihE9NCNu26+N0VRTbshDk9f3BThhP55JYxXdPD4V7ht1iMY\n7EGU\r\n=pZ/9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2fa035d4ddfef7335619a947a89d94991baff445","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.2-pre.1794"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.2-pre.1794_1601124146216_0.8319058349880626","host":"s3://npm-registry-packages"}},"0.12.2-pre.1795":{"name":"piral-pwa","version":"0.12.2-pre.1795","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.2-pre.1795","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a19384f713aa598ae4304e96462525f0900620bc","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.2-pre.1795.tgz","fileCount":25,"integrity":"sha512-7ZO4kKkrVZpocgDwbH6bpRYX40+CxOgW89GhFD4RVQQkayGYlVyAnwq14ZixDVjVrBRn1flQ+jbilm4IPoVXUA==","signatures":[{"sig":"MEUCIBosdv2na5ZoFyML/Bnv3Gl0snxcwNpdWAmemQuvfbyMAiEAqdx2vOYrECX4L5uGTHkcF2pCfT+Uwxo+Q15n0iUaGfg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfb6JtCRA9TVsSAnZWagAAdHsP/0kVuEyHzV5lKTulWXuW\nk7YXhsRUDh8uwcC1IyivCfqiGxN8ATyiRERQjsqo5RXyqs8Wynwx5twIaMmO\nekIO6gr7P0kebhB30O+SmG6VvCWJzrLKV8Sr6UuhHG5MKfywzoMB/wtPyGP+\nZyMv0WLVakBkHKs48uyGshFGshnhV2x4za8E9fP6Zm4vW7H3/HYqTv7r0HH3\ntwdjvDTPDd3D9nvfkvt3VniNHR3Wr11EKlxfM3fMgpXd/aChFzVeNFmWJKdF\nFY8AcbaZMTYt9KowUyZuQDDBoIByqDwwdQBpv1bKFhbw9L7Pd+N+3HXPau1A\nSE57ow7Ob70AkXO0A73+iskyO/TMafx82BDdxO98PdJomA7t8jRmIOfLCzst\nawkMMZp5BnpbvcFZo4ARVH0bOVgWdjkjXe4nMgHElXbtdPzKUbF/+X5HE1Sn\n5c3ytLq6zHmRMA1ip8r36l+aFXfqaQgUpFXnd64C1dbd70OKic/nGCwJxy5s\nDjMpkL4IQbN8moR9uG27S9hTDSisMCCrFNtDJOIsVW62sC6dF10FnizMc/vf\n+wqo97GnlDSBsrDzBla2cTfA0ANaeFH2pvFyWhqeAn98sYXtWOa0rxuPgP71\nu7Lo32cEnt9DI/214CEkEn1fYKGdPhP5DVtPqr/Exv2QVeIdk67DLn+g7oVl\no52a\r\n=6hry\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f7669188fcb7364cf457fb0de1d3ab54cacb1699","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.2-pre.1795"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.2-pre.1795_1601151596960_0.4083333407345766","host":"s3://npm-registry-packages"}},"0.12.2":{"name":"piral-pwa","version":"0.12.2","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1c1dd9bcc4f3ed485e43d2e128aaba3e71ef6032","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.2.tgz","fileCount":25,"integrity":"sha512-8H5D9pBeITXghLI8nz1rDhMrro2DDiy5C6FwNqawOoZeZx9Wm93m7NztZsFT+XMZYfK2JY4exBUavAgjWAnXZg==","signatures":[{"sig":"MEQCIB0C31yGI+5sp+2Oa+SibkIu+ap6FOAJlDGZz+JxwTCrAiAAtewogkJ0POV+jS9Kdr9FosnXjT3U+TuFsrnCDq05iQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcWPPCRA9TVsSAnZWagAAiRIP/36ZUsJYq/eF/yRq205A\nveLxRqM/aVeD3uZ60ba21fOksLK5kehPug5896a+gqr+mOBvn5TzxvGGMj56\nFdt2/WTAD/Gaxyhtx5pVULYKa1ci+Clc+UaE4DNGKmFVcDnEAfY3RJzBCE+X\ntj+1jLxj1VqUftdn9YpAzzKBYW8DZ0P053jgek1Xm7iRox5gIljbtn1SHIpU\nCrMTd0M/Hcv2H1GPJhOJk3LzwbuU20K75l+kuQIC4oixhUHg3geLua0Hc8CW\nRAP95KmJ5l1h3iIXPeZmJV+F+/33qweL7tAQu5qjaK9amvuXxUE1kqceTFp/\nAkMCzWIEniSn0pw2w7zxHmb+YUFRm4x2Oqm9WRAx57HENlHi6zXWMNx6dakc\nAHawcniv9VV5mFeTFXC/d9f0D6RvNtP5AeWb9JLHtOSCuCMfGOxSUDDhlWn3\nKTFJ/KyFk+DNO+4wcMrosz+AFW+hhYJMdo51vy3s2ITN+8/eZSaV3tb/a45u\nowYQcP+yABlUKBSl6pj1ec1sM0A41E+arqt2yJ4Aal20bncBwJeaXtWQ/oo0\nsVdxJLajTMWA28Bb0CX1Jc4goKXDeOicV2X/qBsM1ZW72/gBeXF5qxTikTvX\nMvUtvWbZ6BMeSuUbmCy4hjphzOMz/qH4ikB2ElqaPtrcfYMkfR74lWT5CqZ9\nXQ+w\r\n=UHgd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"f80bdf8bb2e29d6f3394567f9607e6607f02c80c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.2"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.2_1601266638757_0.5423868471836892","host":"s3://npm-registry-packages"}},"0.12.3-pre.1815":{"name":"piral-pwa","version":"0.12.3-pre.1815","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.3-pre.1815","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"dc18afe2a41b776f0b2b3f9655893dbcbda174c1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.3-pre.1815.tgz","fileCount":25,"integrity":"sha512-oYraQJVeRV7xZXB6EHVQJqxvD6F+JBUOE92ORkz8p4p1JCQuFll8P1anWySOc5uz/aQ62d5D/CTTRCCR+bAAVw==","signatures":[{"sig":"MEUCIGbSunrdB6zXfjGX8sTpAY3noIAZxWnhaaIZGv9DmSEiAiEAkQOx80BVvCZHdTTDTVnsieFtw00s+CkGd87xPbe/Hck=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfexOWCRA9TVsSAnZWagAAitkP/2I5d8vSlYjfvcz5H6yp\nAJvOkAeDuLSX11BR0l08wuqS9JP6X9/H2Tivoe9EAynqPj4b7PSOCJzutIeI\nmMm59j6JnjVPt4ggxrYOGtCAAMUdOZEsgzQnLqBEJrXTTIldDbLDkDqSCZF8\nmy17w1NTcTyoCku/ucdH1dURRNYMieT2cxBUWkgg7ZdZPKFcqVFLPzVjeZZe\nlMrUGPtglsbVesFDhY41eBcGc1a84Im/nrRDQxr01/JVUth5y76s0Gw2SDnD\nu/uw0YmngAD8xWIN1wJHG30d348cpIK7xom5T3otKj5yTwniosZjvkQ+xCGh\nGRyvtThsQPjSs5dPUatRTBXGlKdVCdB3obleZzyUCYr5fXogJe94y4yevdOn\neb6Wd4KAGy8GcmgeIS2GcbcW5+tiAXP2iYPluBJt/1VbKSnKmHfk5CGId8Q3\naPf4D/QOSIhZcGGPQZ8RiUzZjY94gvcDFonz+NMghMjCzDVe1jQeknJeAUO9\nikDHjZzuNsWiP3nSw0hRvuAI29mQ/6c0dJXZWFY5PIKceJuJb93s928BJacu\nnNYUlcn+SPvSp9wET75jJQM0eE8ioccoDu/mSxhQmu6F6j2qVtOUeBRIVIjq\ndcVdiJ/nlFdvWGQ10DejVbebUS5sfKDRfto9AjtBFX42LPJdTTivcVEJxvEp\nnueC\r\n=yYms\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"032de6a264fa27180ef96fb3a6230316ff2d3732","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1815"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.3-pre.1815_1601901462613_0.9453449453821476","host":"s3://npm-registry-packages"}},"0.12.3-pre.1816":{"name":"piral-pwa","version":"0.12.3-pre.1816","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.3-pre.1816","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"baef00d6d97222ce67b3cd1f01c156ac1ebbdece","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.3-pre.1816.tgz","fileCount":25,"integrity":"sha512-or3Y+mBd89qr8Emcw4krcr9Me8Fmt4Me/XygnUo5M3g6lqwnPV9uKivL/Y01Ikxxy080piAFPZnnD3WQTRCJRg==","signatures":[{"sig":"MEUCICkjBua5Cio1/FsD/NzPdHPBqVa5eCSk/G5p09ufsBEBAiEAjU/R2JPXW3HeD14z1AckPJIDTF6CNxkdGPLsAHuoHfk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe8DBCRA9TVsSAnZWagAAwNQQAKIGIEyFgKIkIIfCgi6w\nhaKRMeG7hiwZKahkTK9g54/yC/E1tGuQtoEylWeVMidLeV+sNsJhnoZZuK8l\nE/rSNAXCHtQAwz6HrB2piZEvC/OOycbMs9xKyH6gbVDnsF/20ee5rE1MMp4l\nFd0gtvfMu1dqvLMBGZI3aAovU7wc6g3+KZDUzK9Pdr4APl/FA8FOhWtULvX3\nse6yeHnI9ttP30XpE5uwylwyfIPLXrK0qx3ENy3dRoOob73Y14x3c1kbxHAP\nfKrHZn4eR2hsrI8WQQmH3iJGOr5P8oGnce0Fx86KYgImSy3KwCQ1OeFWTj01\nrSs2Cjy/pYr8ocGwAsmhuj3HZYNOD4IwmEXqWkRk1BCg+KHjdwsImZ77DOB1\nCmVoMyFiCSLnhfTQzTBj32u8JnzWMFV0sFc04SgZCv/DChJ3BES9N+KU6uw6\newkuYFjZBh1wK0pAaYVsVLpZbnWTXEhKAg5j77V23VsysM6xGR9iPuIJ4Ka4\nVSAAQyUkKl6UWGbu4rgmh+XB6NI6HUWabXiYnXhgCRrazVzxEDB9JD8R9fiX\nGBFfkID2l1yEpoaZTnDlmJN507zCYJ1LCBK8t8guY4gp+Sc0ZkRG1zAUTxKf\n+Q8gEPJQ5pogymfKcZgWBmGSfHuJZK5znyEOPKXJFBXZtH8zVgI4mMT2rb6r\n3ErS\r\n=eMTm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"14e3ee3b98760dee8a5e305cfb52c981d1a28319","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1816"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.3-pre.1816_1601945792486_0.13682523285553083","host":"s3://npm-registry-packages"}},"0.12.3-pre.1817":{"name":"piral-pwa","version":"0.12.3-pre.1817","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.3-pre.1817","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e52d6cc36145c17c1e0ec052290a2e2790b15969","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.3-pre.1817.tgz","fileCount":25,"integrity":"sha512-N630IBiwpdD/spIeGdZWUyFW7TGquHhMP7PMXnd3hnABWlfqOwCUcRQvLfolJmorUv2l1HlhE7e7S5zw2w7pVw==","signatures":[{"sig":"MEUCIGt5YSdD+w6iLUm5/yCkBo3PWOrNEcXiHUVjPCZP5Vy0AiEAxvUS08CYtsUz8AWxrQGcC7yP6uqBQkqC7WUra6Qik/w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffPcTCRA9TVsSAnZWagAAz7MP/2JUdh4qMPIQEnSHQkza\nTmgGktau5teEk/z1CJw6fSKu9FSpIRaDqLgkAfJtz61AYgDXRGtiXz701/m8\np06vLeZNJ6xhh0w57FFPSCtR40hvce6M/fq3LVUz9ijItpXbb9cugqYdXr3Y\nm+laQZf1ZfblCi3IfTMoI0wt63csWpEhnJA+OfibbFkXBGzu2y36KZLk0lQq\nx/RMja4RiOTSgQg7R583HesvNv3qTd30G93Rm+HvBd+TbZa2yUcrYpqkzUnf\n63zU4O4TfBi1abLlPx3IfYBdKpBkI8gqQW5enlqr+M/flWhGW+q9VnnXQomk\nrdwdTnGVEDOZbXEKQvJuP2/tXH0tamkkq9dZG3p2f4+4+nnbl74iYcL0zBYu\nW0w19Ixnq7h+17wzReyWCi/KejU2sZXQBZFp5kamaQ68x9veevUYVbRo7Dzs\nW8qnMx71Ve/29G2kDa/9zzSOldWNJLwYmYgDXwe99PHdj62Ayb1oxCP8I4qa\n7AJ7ufWJCxwjmETt7lsv9NMGjpCWq1QowhfcYsv45gB9jonwd+7tNg/5deRX\nqBBILjsSi1MXJBctdD4XeEguBhP9SRncs637hhMA/duHS20YQkMSfNLTv/x5\nQ6Qe6D2aPyFXHM4P8SvEYl0a5/EXBOUUxyYgDnfzIvGsTClxclklKXiaOEWx\nSivU\r\n=Mn/A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ac0489a1f8590468d3b3669d9246d7fac1eca763","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1817"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.3-pre.1817_1602025234774_0.9630434631644003","host":"s3://npm-registry-packages"}},"0.12.3-pre.1818":{"name":"piral-pwa","version":"0.12.3-pre.1818","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.3-pre.1818","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c774ff61de55437dfc62147454f970f3815fbc03","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.3-pre.1818.tgz","fileCount":25,"integrity":"sha512-0vN9cgMrx4OrmJHyaWrvh5ZL42i5NLsALxlWq3nx2V4Whh/BqtyvRnwbvkspbmaH2bcd3iWsIXPPGvBuFpNk0g==","signatures":[{"sig":"MEUCIHqUnH3NgMF8TmEdqpjnOnNhPNJqDNqleKA020ckczksAiEAmYZmlh9+1qO9jwuto6t9SutCgz7PyOlD9euZEf7Tyx8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffu2OCRA9TVsSAnZWagAAu/8P/2KuLbcwNqAns4p8pFz7\nBZ5Bj9lmXN3FSlsg+7/j3nMrW3j8zLYMgO7tyHTMuhxxujQ4VsIprEOxIeKw\nCBjF1eu23FfiDlHGSkpwWOFfKDNwJwVZdcDjZyck2qB7LqSwbq+9c6Z67IcW\nDg3Gdg3RaKH7a5/SlAl8QkaV26oVSorGy3gFc4lsDCwrDLuXmh0BbONr/xie\n2j4d2rvyPnzXHNaBrDJOdpNpEezP4GpnIQu1Bj4jX90tUFFkKih7MPrR+iO4\ngiuDA2izRC7vBIFs1GoAdtXGsdUjvMTv5+sfyR03xmomOePFeyq1Hivsxcdm\nSqJ+iXOXH/CC/w9C7Pk9F6qwj0/xZ1R9M4LZBmwyJwmuOHTSh/JlONYSr+er\nPcRDnJj/C23vmQORdSGopxDFQzn1MvBunxg22+kN0lpn+Ty+qG5PtIqDtMo7\nu3cI3YeMQXv+etE99UDnz/ZJIO5ipmsx97RnbXx89Dztu+0/x/Q+6Kfw7Knn\nbFCcTYRnDvSItA6aL6W5E/5UDaYvJ72mZiPRN6KrwowY4w+g5f+e2g5iuhov\nrsim5X99Hxu1e4h7n2ppks1QB2xZE3ZvU6zaAVWABQxaoyuTP6Qnw9Jm6ESs\nlbaOffgP5EHNrYABNWRfO1aEDvPBawv0MLdZA2MgT7Lu7dQtcP5Iw6b6jF0x\nmGRy\r\n=OiF8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"fe5379d49d1992767f3edacf4098e3613386a71e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1818"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.3-pre.1818_1602153870210_0.3238457382092703","host":"s3://npm-registry-packages"}},"0.12.3-pre.1820":{"name":"piral-pwa","version":"0.12.3-pre.1820","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.3-pre.1820","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5816a279658149ebf8d3fd07b94a43cb075cd081","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.3-pre.1820.tgz","fileCount":25,"integrity":"sha512-MYcmP4E1lJG/3Cdl6aqE7jOIuBkDHZuMs+d5m039guhhHkqR9k8WOgggr0mamVLxtt+at09sKrgP4+lT4DiG1w==","signatures":[{"sig":"MEUCICWtq/6yJIyPbeKharDHD8rDojOi4+ci4AYH33dxagwRAiEAm2/e01M4EUyi2laDm0KG04MFL7NR5/r0ZT3A3pygky0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgHumCRA9TVsSAnZWagAAwEcP/RH9UDYHswVg4TBRLkOo\nxpnky0sGK1UR6IfIQHl5O4nfpiW29mwaK6e5WEnWUgyaO1bnoG0DzXs12ETC\npHMVq0NCim7FkHwmmbHMqIYUMd3lAV+CYUEZcJ5nKuDKRuLwHkCd7tfhONzG\nSXebOgxUEnYBNnVOKcvARlatYtSB7Sw5P8I7/biwKnG+slf8mdGg98xcJx4q\nB8ieiS91WgdBccdUfa6wJFYyD9hNWME5mEBRDkLweFjVoZN8cpQ7rBh1OvAH\n5A2Dfjx7Yj+QiDy4hMYn5i+El8rOsv7WunE8AEdEbkwHNkMY+kQDNB1FPSAY\nKXf3zh8pySKX1voqo9fiFvxQ7FJSfGvFVRRKa/Sa45hEix3mmSbH9mVe24/J\n0k0GXNwquOlo2s0qTg6qqafcd/XEkNbjSpkf/9FlrCjr3a/fee1+m6zbvE+t\n+Uto+K679OvAd2riiMxL33XTP1dElJClMSaeFu4owMjEai+BScdBdVBEawE+\nA4EGKou2ygf0QJbDhtGG6uF0mtep3bzQ3z/gKuhs/ZdMY/07WqwJpv3H4hB6\n7mGjlEMuPY05XjzGvD8YLXuHK4zFpLachGVBuk777sN5I/cwkw2lTdQJnxfa\ne1biigvImx2LmKexGVoX+//CYwOyCj95NdqXjxytjRVlbaKhcP0f69AsMuck\nunog\r\n=zam0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b1da7ccbf75b527abc897a8c5d6d33c63f156774","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1820"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.3-pre.1820_1602255781720_0.20491183277041847","host":"s3://npm-registry-packages"}},"0.12.3-pre.1826":{"name":"piral-pwa","version":"0.12.3-pre.1826","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.3-pre.1826","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"301f019c681187b287bedf64de44b04b29b98885","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.3-pre.1826.tgz","fileCount":25,"integrity":"sha512-Y6/pw+8Od+kOnBtOpK+2cqfIU8xtqXSPxM3/GGOBBLA1Tc9WFgDgucuNv1wEOkYM+NjsZNLLpknqrhL2GfNR4Q==","signatures":[{"sig":"MEUCIQCtYRU/s52+13q5NbZHOpSqrQz6by/MChrKBZJwypSXawIgZzxAu419mU+IcviWc8NwWn70TqZItkvP1VcG4jIVfGQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgPHlCRA9TVsSAnZWagAAeaEP/ig/rD/8WYd3v29vzO6N\nwMR3dIk45vlEavhswCFevjEw4ro0yMqMpGk3tPq7vl2w5+22oGxS/Twfi7Rf\n+1wVoRDjTz/18PvFjNasGCvudS6igQ1MGJNdKuRXmaP9lqCWakPcw3ZUI1xp\n2la6lxQCwvvsqda0nAakhzAISDwgYnYbVvMeXcm5BFGoFvZkoYZsekpJmtZ7\n1XJbdcnkfCBXdCznZ7fr5jEhaGoMgGPdAbkw0uPTolTcMjfcPJ3u0tveUIsF\no3nlwtwpZ6RhHzaP59fF1QiDIJsxN0rRl3M5uq3LzzB6hbs0aQSNZRgtDTKL\nYZ2vRB7LV/MMKijAvLQlukZxV2tgWk0phtE2TZnLFr9oEIwTjPhM+l+FOaD3\nUTfpsqNukPUuWzCprPW/Se1h9UFQgjfEDoAFF8MvM/9xWo1yJ7C8pUxIsNDC\nNpo8gl5lF+2758IQMPy6hHXnA+VbiEu36y6i8lUX/ivSVT6mp6tq6NazqtiE\nXqIIHXTWaR8QBB5BqXGvho+rq7Emm3uRipaOhjyRH2rD5on7Mbx8Q1T8WXPs\nbToEdazQD/X0Cw97/xiY2xGbCClki3cRzXgkH1dB2IXF7XPuLQV+kWDlyqwD\nrB+FEqFpIQOnYo0vstUrq2M+Trx9ujb64WlYh1h0wDGl1b0PoYlIjC01zmKo\n9RMR\r\n=iyRq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f986877e0ddda18086ecc83902118def1f43140d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.3-pre.1826"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.3-pre.1826_1602286052900_0.4636239075595201","host":"s3://npm-registry-packages"}},"0.12.3":{"name":"piral-pwa","version":"0.12.3","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"22197781423c261b88fd7c61f549d9cf12c24771","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.3.tgz","fileCount":25,"integrity":"sha512-7Yx4JKA06Psc4QJlWGa5m4M5o7wP6Tbr2N2JXFUzQWMuLUheplfs1qBjP6Iya3vLi4TBKpSVsD3gPK8YO9/kfA==","signatures":[{"sig":"MEYCIQD5rxUJX3S6lw01ED5LBAanV/IxdJqAIHtoV/VuTWDyygIhAPD2hpLmIGJCr18UAzo7laxlbvv4b0zJF4G7t+FETYEE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgPpOCRA9TVsSAnZWagAA4aMP/jKwNbPeRttN1vk+WIq5\n+xqkPHZGSVp8umw6Jpw0B+1QMcykRNmc7oEg8fjczpnUEQWTCmP6xOGbhuTP\nHeugvDxIrV9hHDhPCt/gZIcAYxRmqutBPLJJ416yVrLJ1uJt+whY1P2q7W9y\nELoFrFuOljPEjM9qI795QbXCON1iWAvGDcNcN4dHl0T72P9dr75J7J2im+Wy\nwMWy9SSqP2DU74iuIIkyVvgpQ4LsCvRlEKCpPrMRLZsTvzlZmGoxJw7cHdqF\nBt2J9BR4mOClYUeATM5KKISAZaofAJSXbteV2GTZZTGH7NDT+KRhN+1d0TJk\ny9SU+tI7hB1YjWeHOnFymv8eFRhVY8eZSJAmwKIV2Cj4QQB3Ce6PiJBVlZWx\nSKQZNDbAECh1zrwC7aL/TwxU2QIEDkRNSJH9y9gRDda736I8h37dBfwLXRXa\nhI76VowKMnF097JAMnPLStVPfunCF+Ea41KnyvR0J+7yrqMoQYXBHNNNQd5Z\nFuFbVdpLIziYbzu3r4L3mBRMZXsiOCqHfKh1COM2vO3oo+ktSh2836xSiSBB\nbLrClXzwY+edQe0aBtHnfG+aHch4CcugiCt2TB4uUkcFcGGESzBL3HXE7Q1P\nIBShMJzcI4n0LaCsVZDhKEugr7iSOkDivARlg0Rw3v/iNGUZCYasxqgNB8N+\nRu71\r\n=lMBQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"64f9178b0eef6c6ad78f3aa6e410719dc88f3ce3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.3"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.3_1602288205685_0.3092700207897956","host":"s3://npm-registry-packages"}},"0.12.4-pre.1830":{"name":"piral-pwa","version":"0.12.4-pre.1830","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1830","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"37eaf2d804ddfe3c8cbcbd6ffcd4b271cf007370","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1830.tgz","fileCount":25,"integrity":"sha512-2gGLNijzu0ZEkwfAZCAGla477NBHf954zohHPDLHjCexOaxLD9spuxzTjJP+6E034mqcLuq3Lgbu6+MIGtpQhw==","signatures":[{"sig":"MEUCIQDMZCHPhDYC4JeMZomDWDlcC5HpvziwKeA6StfR4iEU7gIgMcG8ACS+B7F8+P5usWNxFPERPMDUYHuHd5F4WwGwLq8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhWZZCRA9TVsSAnZWagAA/fYQAJncpXENlFsieipPETIq\nxmgSpWif6vEvCP4HYiFa9/eO6iZ9wP4MFLOsbjPvM2IjCFFgNLZ/ssRmjM5L\n9GfQ9RWaoFAK8mZwOddqBdWXrfH4Bqdbb9a+6BJ3eQcypGOQvSff5h70l3lL\nfpUdYppYvtWvZyvVBz0pcM80pOyz6yCf/8ty74uptOpNkDDO1U7/xVLGoV6D\nroe7D8xBZriEDu7C5tkpdgI7jkZMepdGH87Mo7WWbMr9p8QwEnWsRr3a/UQh\nl8tqiNvN4NruuFwDbi55cy+45j+ftO3Cg/pRQafImbbZ54NlHkbaE4U/uEK+\nyjQFBj3RR8KKFbQ7UhaoVL1S5JIciml6OV5IaAqNClYg//BWZFZpi8hEwNFo\nmR99YmyJI4kUxR4fwvSA3tAtFyD5D/hEIsZmFvaPerF36dK+lr1bfh2P8+Kg\nDOjeBFilmdWanFUMVjHKd+I/nxK6Ccq+VFxHq0tsNftsl+L9HNaf6QqUoPDI\nqa5sjX9T8U8s6oJnCLNp7lowp841yjKrfiY5pLwcM+LLEua+idQ3uNA9JQ6a\nqzKrAbmH3CsqwQOLOO1nzMr55qOVAhRhaltSRYF8lonid6erXdGb00w57hAT\nSpgea9c/oVLa662Ts5pFdUpg2AdodEaMf3q1p7kZ/tdDpOrwDx5YAB3C77uz\nYWzv\r\n=KGNH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c0b0d25095a1f4d811b837a1adaee65a4fdba445","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1830"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1830_1602578008987_0.7379560085809067","host":"s3://npm-registry-packages"}},"0.12.4-pre.1836":{"name":"piral-pwa","version":"0.12.4-pre.1836","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1836","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"97587068bb0e65a3d5c1c323feb76c7af542dfc5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1836.tgz","fileCount":25,"integrity":"sha512-GDQ182F9Qv51lIXtlfA3wIvxszklp3vbz0xHJVpDMYDAWmhoc2V1yOQxn5A3BARtA6CyMFJTWOrl8St4RwEaOA==","signatures":[{"sig":"MEUCIQD/GPAd22lMOZpOjOIKRmgStv5MnfLQ7gmMTAhLrvvIIgIgaN/PmBfJM7woEzoHOg8IBa7THtYkMsgS0OidKgVab2w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjqihCRA9TVsSAnZWagAAeTIQAI0nZ8DruCoLgoD3QThp\n6tEphjGyXWCW0y/eKmkmgSfc6Ccw1HzhqrsYbMvr7c99zx+qbi+8SydyKLni\nStab72PPPHX7DsSKyMHhH1pSZuyG47NTiuSS5cwxK6mFwNIAHt62/WgoMF2K\neJP0U8CNNFxUmV7iHvwYKHSDQpB//5NWhXU1afSX5e8koZIRJT1vB17qG1yR\nWz/eoPm5sm0IxVy6sEboPsPuPiq9/1LvF/oEP8FVb+QTV845y6NqIM+jw04I\n6V5Cyh0mOJ5ugOSEhaJ97/SDc0QXzKntkr7D3z7uDj6mRgW7yNYBw/ZahHZT\nph0mvKJE/Ogg0GHZbk1JVs05EirCSLYum0ZFowCcd4yci1NuxQQZDBKsN8m1\nGAEos/QK1urPep5ITeSHJ+jBr46h8DSmxYpZ3WHcBgxfsk5GlosUSJ41KgXS\nkyAl0taitVpuEAVZbs4GH4LNGn61rySY0ntcHdjjOroYEWi+b38jYCykljyb\nh7k1b8L3MHXyalXpbfeW4BxhGIN62m9BhjbGctNcMvl9tmKuI00Vx41gCHSL\nOrwGDe4NSlSZKfFuUUMEeMREjcTSjZTvp2b3y+ZYDQNdCFwjRuG6f4KQVBPw\ncpys0w9cs5AcsGWCTi0YYQ0cfDAx6zVvoo0Go11/znrWeYO97JOa9PNooQX3\nEcoG\r\n=gfBf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e7e6de252d0a3e1356b0b3e644a3101c0e067228","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1836"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1836_1603184800707_0.7523065203413075","host":"s3://npm-registry-packages"}},"0.12.4-pre.1846":{"name":"piral-pwa","version":"0.12.4-pre.1846","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1846","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"38f64bc9c42c6a71afd7850df437d3e53ca03cbd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1846.tgz","fileCount":25,"integrity":"sha512-YarTk1mmtASIrGOvR32GYeYQJM7gg+AL7jowsGdGOifnN0bhP1EGI7XP7Ql3XBjvJmWjX7/QnXXxLV+hPf4xdQ==","signatures":[{"sig":"MEUCIHvVICR15VgzYS7pWHjIlVrhijQ9Sd1kk25cbsknShkKAiEA1ZzgKt1l3X/wvR7QevP4ioJ+Cd06b0Pm4cNKFCK0Hr0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkJ1CCRA9TVsSAnZWagAAA2oP/1XrYTyjEY12OnXh+EOy\nxJkriLlPiYIJkG1Y20vqbQusZX0mhUNxSn5U3RBAqX7r2xAUVdv5EkkxDS0m\n1i4FH/GV+9UTVt1x9JNzv4/bIFKB/3OCMKJ+GMp76eq8LWRqeeEuaBIsCKMY\nO0JZvINehZy1LE4YVL8XghM2d1ViyMeAgpmOuh8KkdbUcomN8qnxpxSt5XDp\neITzXPiVgkZaHAsOTL9z1nu246FWCmXpglPVzdTPbrjNE4cDpgdDb/i+WTbe\nm6m79DH7DK6VIjP9BitMXYdb6ictlL9ltBbgPXdezTuP4gD7j1rshXNh0lPq\ntHNq0M0KZ43xETFPrFJg2D5zEn2302baEpw+7UaquIiqmTD7UTCLW+nbmJiP\njuzeSpOhAzFLjPF/CC0Wy2Sc+58APYNz9YT0d53d8W6/ajjFEdg3rH0k0GSW\nxMX9a3S0F/FsKwiOekLVUBO5tN0cNkbqoKTEspg55Wu1duK1ArR2K1unUefS\nR1/EEVOnMcT/JmOZbCeiC4XUzd0eqSObwbYYV+sKRVgb9mQw/Dkh5BHSHABt\nbOF2w3AshlB8MfpFmRvudJEsHJTHzQ1hH06BpDeS/CWC7zumm4700BeeJJiJ\noT23loeFJd6T8HNWH4LorW5o19OChxpfd97k9cp3f8zJZMqPc8gFk9DiIYAw\npavx\r\n=a7pB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3a062a650d5956c981a353ebed506e3fdfa22025","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1846"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1846_1603312961176_0.8919818937446542","host":"s3://npm-registry-packages"}},"0.12.4-pre.1854":{"name":"piral-pwa","version":"0.12.4-pre.1854","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1854","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"738c262cf398044edafae237f1a446c870f18b84","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1854.tgz","fileCount":25,"integrity":"sha512-rg9HxrPGDMRQfK+scCZpGz+YM+F3tkxy30oRCLWqzQjA7qAILo5z1tpn72zxC1Eih7h1WGmrrvEt3qk286idMA==","signatures":[{"sig":"MEQCIF3tlNeJrijhKkz5oNx80uMhN3JPbsiw1VbdLs3scFa5AiBe6pIyE3qrz4hF5Q6m4kh5ZZpT6GhorrXuQgecA92eig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkuGACRA9TVsSAnZWagAAWIkP+gPCR7QvYO1XT7K1g7w+\noN6+3rR/Z7F036dcSsjQKVG2D8QUOoZ4u0cMBylMnop0w80N6DIymJ+ZbK7Q\nkgdi3QKAEIQBdyPE9O4HYDVycz2nEh8SgZFAa8dFu7M/nj6aZ5ZvtmBU2E+H\n61BExuWwljqH/FYDwH3gU7bq4ph8ypkUXNNxjGrVKmLtCUaPt85karHaIkVT\nHyO84qhsSSSZMMtXIVkf7Ed7MnXH77bwd5qOpMfYwqWWWoaiD9MZNRYQAwQS\nwLxUFfaEGFPaLJxTRi33YBI4VAByvFjrDJgDV3zVpB0anMeDEVkPDiGZXwF2\nTBnILfD4Irq7Hr73wQMum0avzPLAcQ2SOlYdjj3iN0LrOagh8UZsQ+dx3jSC\n+dfuyWtIJiv3nSmpP0iNQVEoCr8lPmNwsexgUB48tzmOP0dQWNUUd4tFqQAS\nT2CswNiVA/wg8mYKwcDs67UuRnEHDmzEwqQIUtKqPn0qvoYc6lXsxhKQuSSe\n4RcMFUAXS8ooU5IxHHN5WpP+1i4rbZvzCMtxmycBt13QhPedXt0eHWp3NAH/\nzztYosDOP+eBroYdSfgJbhhVhexilAtTL0/NvOkw5F8fqbWE1kcKl1iyLk4J\ni6oAidVTEjeC1Skonn6eX6ARiVvrIyrVECQbMvicOwy2Ru2M0d8OXeknEWpG\nBgy6\r\n=zeuY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"771c641f18e6a3719f3121523261236f7e55dfe5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1854"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1854_1603461503633_0.8100765830528784","host":"s3://npm-registry-packages"}},"0.12.4-pre.1861":{"name":"piral-pwa","version":"0.12.4-pre.1861","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1861","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2c152f3291377a2331ad0cbc4749ea4b295bab27","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1861.tgz","fileCount":25,"integrity":"sha512-fcIatvNVchY1HWm2kSHrP7V5qZKbbFTS9DxufEbWO/WkgHihF06e9gLz53Az+rDg29GIvoi129P+R+T2t2b85g==","signatures":[{"sig":"MEQCIE4laSsAX8Fdq2jpKL1X4cAHYLFIHb+Igub1uMLbVLQnAiAlXw7qtnTJjb00VN1MFkWYj4/wuPZWPvMNgcy3Gz8dbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmKR7CRA9TVsSAnZWagAAWBYP/R82/WyOoFkj6LkOxbJj\nCcoEpdXyywq+YA2NIZ30nH8CYESOQlBgW/NNDhDpQ4xsUKfpMDyDUH6JgbGD\nU+SQYJYL0UF2901X2jE5NbLv+DkmDngZw3X+c5H070Lol8peDj4H7ilTgukY\n+YDri+M2uS/mOiqqCWaVRsaqZ/MY9mPjw7EKYKznHIg1fMvBqDZp/5DUO9D2\nzEXrWY7ZFuJrAZ5dqE4NzrMqmi2d2uGOWYqaT0M14pIgE1dSjtABPp3PFyhb\nTEElHw/kqGQT/G58K+dG5cz8q34HQyxfW9D+HYX4YKypTj//bPlgTWZWp4S3\nAgOH8q57x00UnSBJWa2NaTI3WC8glb8M4aYkMAJjagpQyDeb+TG8INWYtKtF\ncBaRxhhae4IswheCy35MOsHOmhRVDNrDeqP3mZDbX4PTHx6jst709inEOLro\n8BIjYFZqX33LGhbNW7wbHdjKD/Vx6rlG7e80Gl/NUXwPErjawud1ogLaUeHb\nicIvc43XRFuldwnui6Gu4dH9OzWWdCe3Z/sS21AVZCYhomOCTSI+wi9JcFs5\nQyKgW1BDgVulx75VtvykyAvfCpTLdzrb5Ckc0U0eVO62nnEcTGBokHfa61jA\npZlFew16t/pnFWii/USWR2pVOYVzNq18aNA2WZqAdcH7+NXNPJYIsoTT72ND\nb14n\r\n=C3ak\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"6dccbc0749fa624b9528c4bb74701f76bded52e5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1861"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1861_1603839099137_0.7809080794487395","host":"s3://npm-registry-packages"}},"0.12.4-pre.1862":{"name":"piral-pwa","version":"0.12.4-pre.1862","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1862","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8d48e2e013e288a42d58a233042ff25e43b3773d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1862.tgz","fileCount":25,"integrity":"sha512-Bc7yXNgNUrk2r+Aj9qBVt8mh246Z2ATuViGuGL3KZ78f35kathr2yLI23Eb6rwV97Ksvjmb9yKsGTP+uwJthQQ==","signatures":[{"sig":"MEQCIG8bdIJJVnwxbdBJUvqgOI8yFLHd4P/K++cKbK6oZxEAAiBaUBJ8Oya2KXajcWc6J1YcNKXmuDTFxXPOVJoMUGFc/w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmW8BCRA9TVsSAnZWagAAoJgP/0Zb5retC9EW1Ctg9y+J\nNPLzmzaPNuu5uTQlSXaWZqPWuu5a20GVMjslrpUc/EanRXsbnFKwxPrFBUcK\nahgnRh0yn43bOi9bGZFGAxIEGVeq85SkORdP6wQnbJON0NefbRUNMMpQqerh\nzajNlXWigNVteV3tn1jOjvWRTnbRTtbq+gHetoEJGKZC9qP65kqQBJAAcWhH\n+bWvGs68nSMnffmYzhwVe0PjPGUAdVPDRRn9v5ifcWc0zSm08iJJQGru+MUt\nXksMy3528Wp7x94IQeLTwE2bjU/kRzK36LkVzm2iopngNsXXqHkxmYtBqIiK\n3sLmN8KY5KnbKtt7W+vAP+W7JmIL+B6sp7ijnUYIC7F4Y9sNBhw/aYeMh30T\n9NaMuxWi8G+lPyknUvI/6+9q8KtqAMnlVwj8linn25eJLZuuhMyVKJCyNt1G\nqqm2G2J+Yq5GwVtIeDNIlHzLosbArr1067OHTWi6vs1KFSFflJKTSamH9k+8\nN06z7UFnIFzbGid9yAmOIrxVs0PHJ1pA6rJ/Miz/4Enbe9pv3IDMh5sf6C7E\nU8y1yfVnazlKC9/dXdvDtGjW2MtRu97ooKv8djBzdW/qL+Ovq38nbay98hZE\ntN6NmZ06fTBGPnoNnnPYkGGc2L1r44BrywknnNNqVLxY6sWRTz7FvE+En9GL\n+fg8\r\n=cHyS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f88e40b040a1cbe4c587f38c2ecee966619290be","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1862"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1862_1603890945015_0.9814442186403183","host":"s3://npm-registry-packages"}},"0.12.4-pre.1863":{"name":"piral-pwa","version":"0.12.4-pre.1863","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1863","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"be7c9b483acc53458e30d490a4c40f5914f92dc7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1863.tgz","fileCount":25,"integrity":"sha512-1lxQxPv523aqWsFAaPIWNnIHoM9j7ZYFrKp0hqfeMys1sITOcr0ihHdCTCmUvprQbQmjhKBhZIzPEhU6nhnsRQ==","signatures":[{"sig":"MEYCIQDSDGtjFwTPJS1HuFulR3xt4ojFVHUYYMYBrtFiqEZNkQIhAN+zfSgbqziyXiDY4GGeSEx90tnFXZP7KOrX2rYTl3lP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmZlzCRA9TVsSAnZWagAATBMQAIG68IpAfDdX27pMg6g9\nD6QRIFWRtbF64kBDsg+wrR65rgeK8KpkODzq1OXR0zWLfxtZrxG/y0rkSNMx\nI6vsP2m1TzuHKSpypEQ+wjI5R/ex0Fy0M2FhR7eZevtATJF5huHjg8xP9LwM\nsUUZBJpJWz4GkA1Pu3vZsyAct2/VvP/9uHw/qQeRMXkScVXhO0DLnypMY+AB\n8X+x8TmvQ+UjlKUCexR6zqRevkaOby98kcZ4aRFo6B7oD/Ek3zM6vKPc5IEp\ncKGbBaTAyInHs6UcFn9/CABa6QRhK+xJStMEb3eBoLIinqISh3in+I1CWsN/\nML5fJsrw4xm+lXvpHMJcItyxS+pL6HnAo3GSb6hQhoK177uBPq2jS6Ucqf2f\n0TNc8Nb1TU6IzHpranG9G4EM0ajCCHWQL6mFDMbAsz77VD/nPW8MGheK+v9j\n3mrl11U2e+EF68Ad4uQ3VQB6/00MmTVZQf2GYcb32gP/6uX+mvsNxQn5kslQ\nWKjlXJYR/P7rl0kV2A3U2doHLgdv/17DIoR2Iautd5zXBwxxRyVhRZOVvYRC\nWAt6t28I9mgCKYKldTwzzuKXOF/pVlfmMe1/31GqSiYKe0DW1xm0lK9l9LUJ\n+x43x3cnVCWKhSO32CVX3aT7vjmS+VzuY/iSgguVCYJYx0BkvcXB2VdC17mN\nwVVQ\r\n=tnzw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5f65b95a9547e282467a4811b32b6d76c55736d6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1863"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1863_1603901810684_0.35148613381392546","host":"s3://npm-registry-packages"}},"0.12.4-pre.1867":{"name":"piral-pwa","version":"0.12.4-pre.1867","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1867","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"48dc0cc0130e4a0a882521f7ffb3691495a2563e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1867.tgz","fileCount":25,"integrity":"sha512-AAxXEuXIVrndfV1GObgvyI0i6iGyntMgLRv61derfmToTSMYRVrArlTuxWv9Y5h/Tk1PN8kI//Ni5NKg/q3y6A==","signatures":[{"sig":"MEYCIQC1TFjGJsjlHHx0xEeLtGtl/m9bzD9ujKkwRK3eAgrXuwIhALhrA2c0wSj3e05SpNhp3Gg2LptskKtyQJQQXk6tdLBR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfm7xJCRA9TVsSAnZWagAA70UP/3+S2+1NRT9dIq6jP8ne\nGW5PvoHOyI9/uvMBy+uiYK8uTR5lcu5W0KVLoU9nawPmBcF89eVSYXUvE1MB\n4p2/MvaVu3oY2E5W0/L5f6h7eti9YKk/zQMvcdt6cL9cIK+vSdHGYxJbZQnh\nFl7bPnKgBJeInYah+pAGwQKROquiX7ptuAVgIw44ww2BV7UdwL/CNb/XJ+mW\n5gMTwaFrheuc1Qz0LzRSfgwFshXOHsoOffyjzSbfEXADZ64e6mGRO8E8WJTd\nw3WiaG2t+JEjDgVrELCLoD93r8pB6o6gKCzISCFCPCd/FO6ad9JmYxbhckx1\nc3QNKsXiZQNqwx/djvSLue3A4Aq/QyxepxZmLL0D8n2l9/mwRNBGK+Hs6XnR\nZWNcNp6ZiDOT1Yt1hdNAwKex590W2YwzQ+nBap6uqQfqHyH1Oko6oRoK8lb6\nfF1pQctsQON7Da3z5wOS/jrNkWytV0EcMXgyniTLZvD4iLHBecNGDHIcBYwR\nGP3QuYnj7gzVI5a2VZZ1cZrdC0PaVm4rU1KFYBGs1R8uv8Z2SGym7xljREEu\nLOjqjde1A1M9JvVaMoNSIzMaOAp56WY2rGVcls3kA++j1vbefAGMEdNNceNF\nfMj9qvbmGJ1eXnI34GfaflWbC4dtljeJWpyhr7zdPSRQWNh0idnboxPSq9QI\nLlFx\r\n=eU1r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c16b40a7f662e0937280fff145bea0a4f59e990c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1867"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1867_1604041801485_0.17184406329431723","host":"s3://npm-registry-packages"}},"0.12.4-pre.1874":{"name":"piral-pwa","version":"0.12.4-pre.1874","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1874","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c265200f97b89b611df92612f6958c871175508f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1874.tgz","fileCount":25,"integrity":"sha512-mojKB3+TNnEDi6do02bxEsAm/KlfXa6L910TEKPjimCkjhUvKvqG8kwovBGBVhjOCTXzNibFNim5LuJBCqdpOg==","signatures":[{"sig":"MEQCIAtPUt749N4qrQi2M0RevPauDfj0f+Ac+tbmpmJezLukAiA1b5CfQqIpYAXMbhyOg+lGjDku+eqE8/VcPet4DEwUlQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqy+DCRA9TVsSAnZWagAAtxAP/2aP27zVtN0ESp/taDNa\nOiY3X49ltZrUMecnih5cxKQbVCUnU9FJCilgpyIAgInfC0kHr5na3YF5C9mU\nl6Nl0YXWBeCAre/I7ndA0i6U2HO8/8D+teqVwvq3GpHjfq6nlWx6fbfUvON0\nR4j85I54Tr4cIVnR1dnrJPVaGyMmrHIbHhg8fZrqXCr1y11HVwuesuT5S42z\nJwGTg3RsfLYyAI7qTGv2tBNoDDfRYeP+W1FWr6qVNvRTEm6HbE2DuvPThHVJ\n2yiWIQxi0XzAFIUpVMceT+9tNQcFhhp2FC+zX3E21ikyGy/qZkv/EqdYLme3\nI3CEqoakwLopBFekIlIl8dot/hmPzEn4mEfbeiv884ZbRNPYajHZjPWzDBZq\n9UCw1gmw4lmJaCRvY+RSEPTj5c9MAmhcpz3zVLMbgwsdN6BBu+3gDHPGmSv+\nJaOacoONxIyd43s4+dkBAvjMWBWR+geDLj22oHU0v0RNU1ODOPOoFomGxAl+\nX/n1zK37pNKthjHRcoMlsKGzQTC6Uyjf0tPIpNsvVcfa1KO3HK/DX5/CT5S2\nmoQ/lFfQadweg9M/eFam0IYsYsVgJ7+VtNfQRaf5fPTM4pulpn0kmtylD2fF\nFBLWQkRA7Ksleb8HzuCWq+N+0KEAq8Pni0R+JJPJvyf8ZSfVWwQYbRpZmG1l\nxbL9\r\n=KiMa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"fbf8f516b0bb6e3e5c4bccb1fb0b2b59b9949e38","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1874"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1874_1605054338449_0.212924585538663","host":"s3://npm-registry-packages"}},"0.12.4-pre.1875":{"name":"piral-pwa","version":"0.12.4-pre.1875","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1875","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"39f611dddb18b9e75b0c7ef71e13941979143efa","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1875.tgz","fileCount":25,"integrity":"sha512-fVtHyKu1QdBRDKQBtlo0I3iTZYmuCYAxYxMmcEOWXhFpT7bx7MQpncMZ4BYWn1RO88Vmx3nZjNpPKGiRyHuzYg==","signatures":[{"sig":"MEQCIGdAxoD3D6pmG14obRpbd1LHyiqVJqpfwKEt61MihZPRAiAfRexbpSJ2khOgCS0m3Pmh4l+o12Xc26DbF4jrBvAK1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrBFUCRA9TVsSAnZWagAAKFIP/jPKYqg6iKrI0uoiqGL4\nTzdyE+fvtHVP9KiwzhSK1DMB+LZN72cLc1OdroKXdfpBokjkf2b0lx3vBkG5\nJDgz5N6YWvflupuVJf4UKWGRJhp5kJR2fqbbLO7xoEBAN3SbvTVMRePr0+mX\nEQy/Bn7HTba8u4TPFjJKhS4AsAO4JhADDmc/t3Vtpkh6ef/CV199tWJccXkZ\nsEqF5nZ6XXc4XB8BXJqxkfHlQ3TwF4675W4pvLWZgWgCsPn1/ayX8dt2Kr3k\n1PcPMFsgO27oo5Vfig3PkFVk36hvR1RiTVelSLSNf0K85p3TS6p/vn+wKGuI\nnk3aZ3UVSZY7sITEh2c8Ic4CMSfoyNqSnUCpZhLEfbM80fWwRE7me5jRNYXN\n5gGv+xOoNsgL5X9r9vAif5pJgFCoksRCyiOXCpSXirsJYgtfvPENXqVLp1eO\nWWmA51svnMXPQxzTNRsC9lLzGHN0xVmmirz8ZFcwOBsgiQiHwALgE9hz8kAZ\nzQzvkXNWrv5c+Btx5IJOJpM7s2j0mV5X8iOiTSE0I99tVnNH/yuynNm/PnMC\nhxsODrXuvf7NWn8q80Tvgk9PL/c8Q9sJgNzvvcIjSKmK9mvhgCsX/HXE+vdT\nrP6mzxr99FPLfWN8WwxgjmJxz+Bea3k41arTs3jqMpSkVXaEJGWOhyHhCk3d\n/nxF\r\n=PA1d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4cfade25adaf1d122f7485e1954c5d6fe2f600d2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1875"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1875_1605112148289_0.5615521317369239","host":"s3://npm-registry-packages"}},"0.12.4-pre.1884":{"name":"piral-pwa","version":"0.12.4-pre.1884","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1884","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"139ba468740e96f1b09007f361a4ff5553d05d0e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1884.tgz","fileCount":25,"integrity":"sha512-OhL3mhanFhrXkSYyeVWmLMOAB9NhfJpT8obujsRxY7vdgtyWHpfbkC2fWHrpQnehZyjE0X3NNM57S/+1pIp34A==","signatures":[{"sig":"MEYCIQDgGHMc5KaRztHuyKzbFoCpLEeNxDG8EgrPbkIFrpZklgIhAMRZMEnqqkZUGLGH8yyBNwOjbAUg/FMl6mPygSXOew6a","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsrZECRA9TVsSAnZWagAA5uIP/3kZS7CYQzfbsRy3cXIE\n/W9Vr4irE/wdF8Jh1D3RuJQ2AYjdxV96J4JMnOIr5+4vZUGE/KEFrK3PavHo\nqGbEYu6STq1yLaKsuN4rk4FYITICpdHxII53Dha/XvmkprzeXs6i1QKuUaaH\nUbR8MSEcIyq+N8y2gv1bK98uWxzApPXGK2CFolp9Ee5R64otPPUqOvlzI4Zk\nFV5AM5Glv2Hgl//r0IVI3W9iQEq+1Kl9jxBsZ2ErrHi7CG/LM9+ywdonwnC4\nxUeiYIA+zmL8ljIyHfwSQ+724+3WvoT0lHOMtewMwqtkNXWHzmTBJYqRioCB\nUti0KQpPRO8JANVu705UJfqPplhMPQp9XiIEcQNb5QGtvr3iC7x0DKnkcuhb\n+jAaBObwwWY8faFGp2aQytvC8kWUNjoL4DPCACXAcVuGGt6Xd05rgsdrWLCc\nIs/1+FNaj2RifU6CUKkYVPWNkHxlDI1SlzgrJTplTNpHZ5QvUT+XBxLVZO5a\nW1czrNQf6XyljLVV+2syvKMqmgD+4kyYopYD3/Mtb8VQPgNkvZLDppwhDTgN\nDQmktPZbEHUiWXKrx6DYu91fR6cOgof4kkHwOtWU/6woomgh4uO8xPg3bA79\n6MIu0PPqKADHUMkIjyUTK/a2DR1ku4aCo8AZWbUsWNjHM8Y8NkIENMwISg9c\nvAoY\r\n=F21l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"895939b3c748be94b8b6f5b726088406c9420de2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1884"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1884_1605547588330_0.4459934970356998","host":"s3://npm-registry-packages"}},"0.12.4-pre.1886":{"name":"piral-pwa","version":"0.12.4-pre.1886","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1886","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c2df710d64bc4f92cc3db3319f75db243f3461a9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1886.tgz","fileCount":25,"integrity":"sha512-uSVsRP7cO91eB4iNAT2SY1anrmPTv45o2pZMsVh19Zy+KVe/w8GaQiAAlLi+o1ZlszNLJ0soHsEcYUO+7yunRQ==","signatures":[{"sig":"MEQCIBF3UXipnCZA5vpjZNgKeaXvmrd49CeGV+2R3AeuT3R6AiAsCBc7VIg3Qh/EKQO2RwXyt3EBYCdqxk81NH8wkwBZLw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfs8d/CRA9TVsSAnZWagAAKyMQAI2n3vhKbcLnOLSDPSJr\nDxk3pJqB808OBezYhErBMfa4LliOhLfVLIPZWoS8K9p05Oio1Px+7F1aPKyF\nra1tgGm92abFX9xYpRsEMgi0GjTVhSDH820NssccYKN53sxKQq+ZOT/0tTBu\ns0uBjv1O7wxSLyKOvHg3Z/PMg1ukFyLOKwhGCFTyRSZEy43i2EscNd4EuTJt\njPgaITEWrzsxoDt7A1NDCcB+RMYk1AnvgsoP2gzpiP+PTwfXSEM85J6723PS\ng5d9wF47TqTpmAuEllqqKVx5lZOf9uvC8AaKY1BvCvGt+cKTPpQUtWIjc+TY\nepMR57ya6MY4sVM8M4lNS0AAKZp9WOgbt1Mh9FCgZ8xWRaAdQEoIaBIxOPM3\nH6YuFVI/TvggtaKvP3vcF/oNaAHcyAJLmTbvm13cAEoJh94y0oei1/nSKAEJ\nadjuJmTqs3yWgsHcYJAp+X0MMGuWaofC5Z9PHPO4CY6hv8yNI6AwtmPSotM2\nJ7AYYH0u0U7nEi8Lq/1oiJYrx9clQtPz4fGhCYKUnAwzqvSkxkkxlD9Y8pIu\nH3H2FL6xYGFnBTr0QZAIIGODZMXRV7R4nhyGZq59Mch31CHWKVp5sMlZvMKR\n5AuU4WpyhqzhsN3obXud7MVJvAsnQEP9MAC9c73Y7ZWRqcc2jsU8NtTKRBo6\nQYjD\r\n=t2Hw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f7d1a8733ceb62d62905c0ceaf0e9162e70e626f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1886"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1886_1605617535063_0.12011465398764609","host":"s3://npm-registry-packages"}},"0.12.4-pre.1888":{"name":"piral-pwa","version":"0.12.4-pre.1888","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1888","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"20b2feb1162e1af337f29d8e6202f48966cdb75c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1888.tgz","fileCount":25,"integrity":"sha512-mceJq+YP7p/BoJAnUATDDDZrS9uZvxTn9HyFbtU39blDVz2saeDxcXGl0LQfLEIgm+ZBGu3cN77sNXJXEz7ZVg==","signatures":[{"sig":"MEUCIQDhUvWDj18c840Kqr5PpKCIrFg1xS3bDLBVqLSoMFMs0wIgeXhYgjJ9Sr2UFp5iGIlmkaUwNX1/OKZNNzmPSXAP/D0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftwoFCRA9TVsSAnZWagAA7CQP/jgHJd7ZsyvjP4UNs448\nfxY0o+xTQU62uujiJRsc5O6vARgskCeCR29TIzOTOW8XINDcb8SxVAYQ7KWH\nPNEnmLELU4LHBkQffzJJb7NBnNK0pD1Qp8e/Q+254kWwCZ2nUxbAkRn2cZJn\nHxolCgOjMS1qphKPLmoPWhRJuKlQdDQVfg7rJZRApnbc7vTwrtUWDouNO46Q\n3EromJCbt2B7C3838TF4pZkHKXS5ddQZe/qbH9u/TwU1eAQdILC1kd/yV4GH\nsnapDLuY+TGwHFugJlEWaWDDwGyyMd4bjuH7+C13iHEN+t6J5gnC9VuhLerN\n5R/MMae4bniZsgB954s2QHpSmyPwNSL0dpE/tAMZBtCt78gTeTJlzB0kLSYZ\n9R+uoQkj7KKBcBpaClMiShuFU4pCWeM4lfIO8kDg70Rx9mccKGvAA32fQ3Af\nlcLGVPjb4WPsPo1zMXj0n24JppffunwwuWD16T/IUgu8gRe4Z+/MxyIadBcD\nyjeKTAEdd7hC2BXJNm74CRiiCW1VSbshpr8Ht/tPlApkHwS/40aEDjfzDMCL\nF6cNqt1JgAag6wwHOkVWaE21HRluaXLJJSajv9gWFbEh1amTWXapZ3bjyJPe\nCT+3oweQbV/unlo7UffRQ50RpDUlaG/R/cqYLrj8ubCphNaC8B1qu/NDNmGY\nW9Cx\r\n=vdRQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ceea58fa7fafc633dacc5225dd245376e45e5a37","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1888"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1888_1605831173493_0.6127568162091326","host":"s3://npm-registry-packages"}},"0.12.4-pre.1890":{"name":"piral-pwa","version":"0.12.4-pre.1890","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1890","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7440194798817a0d89688c8f1b42e80e92b2161c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1890.tgz","fileCount":25,"integrity":"sha512-Pl9vOP7+fFx6tJ1x7MogD7dS6TUrx3/CZCxGT2M3/zIs34mnuLne4OB/WbGchQ688FBsrdPJTJM2mHI9eEndCQ==","signatures":[{"sig":"MEQCIAoAdZTDsNhm61qSk9f77BhCO2qHbDDSbhdruPwICRPCAiBEhZLWs4bGrkqv4c36wg3Go6T2qOt7ueApKeGOSyMtaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJft6oiCRA9TVsSAnZWagAAGiIP+QAu9oq/Vhm2brT1+0gs\nCl0cunj2t3NqFGP/3FFLGoBCFcHYLdpz84wq4WKnVcewtmRkyQkSyvF9JAHr\nROIYQxzKHDzheslVEhf5NBwCWCqU3MtyahX90tzlmYGc9ecxmia+tikzph5j\nmk4qE17s6XsJ1ZIPM9UjdTVNl4NIoC/tuKtdjBA3ZUIBL3tfSbJnzp9Nz7mA\nKejrgg/ATO7NGF06RZseTKqOZPbwjbAnGzr6eEB6W4V/9xfyz2nIgSn/Hk9G\nBxw6GdbmfQ7vD6rVnWln4inb0U2mZmFGSAnZNJF45d1ICHXdUFDE46oYdjms\n8n15KOiY0EnMUC23Lf3nPIG4elLltU0GeXfOx2z6mvr7XEPiOcXZMO9sZupx\nVr1OHy3Eb6Lt/i2lUjJfCPuWYOyvRfaAj2BbNMRyq6AawhIFJ/NwBcsCS16H\nidup2UujQTo87TzOjnSxPsAQoFgf6hbrSRkIQI/wrV4vbGuePYe9o3SU3LoC\nTWYoj2hgbQ79yXmY8oaKZfnqgKNd2uU/xvhW9W5n5JzJjFBwPCEwbk+CGFOx\nzSd5S4XzwzizLdijH6CABC5zWXgJLdLd+XsgyNxFqt5ODqCzjgKQe92JH3ud\nPH6iAmztnpFxOLfZcPTADh9tIMuCzPLGGltFKR5Ze8BOLRuxDGrvxvJivOi8\nsdyY\r\n=0A9g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8af97b82a47583ff6c427ed94499df308149963e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1890"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1890_1605872162408_0.40246274133519333","host":"s3://npm-registry-packages"}},"0.12.4-pre.1895":{"name":"piral-pwa","version":"0.12.4-pre.1895","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4-pre.1895","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"616ab93875b5bf7d3a63f95b0631de2e053c5dae","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4-pre.1895.tgz","fileCount":25,"integrity":"sha512-s57Mxazd4RU0oQ44/OQAR0AwT6KG05Oazh7i1sXZcaeHWEC7OH2rPw3y1OtgwuKSwzcrlNqIRwBhVy47gyQg6A==","signatures":[{"sig":"MEUCIQDmL1PJsVvDbr9qNjBhtJswrvvlQhisrcRfKR7jJ1TbMAIgEcoYxPJrXIngnjCkHHgpoM8KfSQaKRZ7rf2C9IsgXzk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuHZ/CRA9TVsSAnZWagAA2/gP+wfq7fPRDJCbjPuD8ITF\nYmMB1B/PJtbeYHwr2iHh5sgbIKEy8jxsXx/agxwnmFMW7qjAvnkeNByyQkzL\ngkXrBbtQLf75fkVPVtp5T4mVgHQNf1se4tYl2WJ0tRvuNCn0ndGUKjvNUPMb\nNxFQE45btWZkq4rC5upYjsVgvLFQYhMfq+4Rwfax1XZfDs7i7nODfXhk2aVH\nWbTNtl1RrMqNnZmURKKBtBLyYxK9XmeP9lWLZcYJucQwsbOOct6Ilarmwlxj\nTgRVDNozzoImDNl5dnoj+JsXwzNjtlJURAlrhZNw1sawJZTzgR59D4ixY8I+\nVVqdshJZbyBzFwfQGYfUY+bUSTjx/ifw0VQcpImsbzWaxDYUhj7dH//PjQl1\nNv48FQFoLUcfW0vdSAgt9wIyA/HMNodRxa4CyUVshyQSVp9i0qbBYd6xqEkd\nayWsjqgiSDimeeHrJ59Prsl16tX4tVCjcjuHdosYFqU2NDT/U8+XaHPlYkoV\n28iuFK/5zA27+ZMJM+s8n/z0DRHdxzxuzyKEz0RayK7Lp4wzNjrLcyXAxebt\nHuVlpyxYph5Ka3HZKQHv+fzrPVl16W2IzpD69J5hqd3EblVeuNZfVeuM409X\narpz3WwD3xvYAudZKWXYRxzvy31i19U9YIrOWb8sXFRWvHb09jsuGwbprLaT\ntrEu\r\n=SYGS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d387a3ed51efe2d20cc172fa9d7c64aab5a16eb4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.12.4-pre.1895"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4-pre.1895_1605924479390_0.44008234029241655","host":"s3://npm-registry-packages"}},"0.12.4":{"name":"piral-pwa","version":"0.12.4","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.12.4","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"eac5287939da6aa95426063bb84376071ed30ae2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.12.4.tgz","fileCount":25,"integrity":"sha512-4b9VVuPTceTOLqrYv5631OG8k+sE58OFvsKgWjE++XylvUsS+gfHTX0ger8SuWK16H9PfubDqFXApD7YoG8eog==","signatures":[{"sig":"MEUCIQCwfHC1chIQPBlzRU2YHeCn2HtMauO/9cG3T8W2ViHubgIgPemsjrbUfKd1imyCtIjz3YnJ/4fEBVlppKZaJqL+N8s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvOqjCRA9TVsSAnZWagAAPDcP/irBIE18eNwUK6hRyKtN\nNQTIUJnfd47tYJenID4q1YR9IGIW8CJpMVLR8Dvu0LsiLHLwKPXK1ZXfkKVe\ncu5rnNx61VnswNQ6Y05oo2LvqndoBgVknjIeIRwdJ0d1mRAc4nxvz0tX9QFZ\nPgbC18jtUTfZwAO104A8n0yNrVZe3iolkUEoe/XEMC3mZp5DKRxw6GKuyMmt\n9dwPiCVI1jIhT4Z5GZOWSgb7XYV2Xs/LUmPcau1tNnj02F0yQfQH8FS2cGcX\nV4ukVAfYbp+bWMkQ6eHluLVoZOjL+LzaKeUYzbCmLB+Ri+92fbpb+h9W/jmO\nCjRGZsfaxjhMohAWpO8GWzuH+t8fLOjus24VakKaILo4GB5Q6cvtTFvUAKHt\nWL0vgVzzw8FhDC3ODo53kBxIkXtxsKUqRyhUB75i7efhCxzPmRfmL+cuR+46\naS7PmlicsHncCbAmpAPnSlkFe3RfeIUZj33gqpnpPxrCwjTTp1a2UHEPr9Ry\n3T5RhCvBBp5MqynZhToaPUBOJHi4nrcaUFsXGyN9KVZ1v699ba9KlcDPZ9N8\nYlWw0P0dtu8YcEb0GzgCMOODTGCMalI9btyjH/4+A1Cc1uXmvrVIHiYgUGU7\nM+drX+mZAKHAF5oiPAH1iQ2e80WpdJqzLCVsZlChqXR4bVtVsEdQNrfWOTpR\nB3YT\r\n=eFXO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"e288b5b73b5047fe43777d4220724dab12363495","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.12.4"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.12.4_1606216354617_0.18733931712426566","host":"s3://npm-registry-packages"}},"1.0.0-pre.1899":{"name":"piral-pwa","version":"1.0.0-pre.1899","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1899","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5307a379bef9ffb091159ce7b2b4e5ca89060f64","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1899.tgz","fileCount":25,"integrity":"sha512-jB9afCsO0C8iYlmvS/K/Sw5UTgaJ/XOWFEWXUeOrMnOBj1v1vkZAUoYzaEQQ8g6m01h6ok7/S2O5YcPO7qb40Q==","signatures":[{"sig":"MEYCIQD9XRrp/+Cuu9KOdfK6mT1u4JR9FAO9wlX7Ob2MIUuvDwIhAO7uinIvbfrzxBqzBtx2FNglgYbYMr/D5U6zEe05n2f0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvQsXCRA9TVsSAnZWagAAYNkP/0dALXDOWudCBDNP3y/L\nCMNRQJqEC8CjAjNEhaJl7jP8D+dgxvXEVUiPjrEe1K4dOoiq6VhcO9M7/qxI\nwz/L5/chKbXJjn3rjMb7IJ4+RvIcSxH677LUcKFDMlqe57EBbuOrORzJ90Ld\nfAgPdcmfQFUahJ/PRNP9OA+3G1nx8fSqsWXtbX1O0cJSLAap8nmFDQ/UOzyh\nJFpOScdMXYhlCkC1nqEhpvo3411Dzu8N8T5SnA1u17cOYgWi6yhs52f69Uym\n4uDlft4P8IrvPjQMl5ORXx00tzJ5K4cB5uOv6rz/L6nxA6uUVXWQW/jQkJHE\nzfJCoxLbUbxmsC+QlXfjJ22ld4I/Q+cGJF8UwD7eqGG0OXbJgoLPowPHHSFc\nDs6k4X9WZUYH9WZ4NiH1Ii5gXr3+DaKYOVNyMdHYTfHIXB02TNJn1it1dLes\nftSw8970yBRZ7jqwXbUePOEBQ8MA4mZHt1jRRT/QDPbJ2/f+gJlsRVitlcdD\nEaftCwVy6NKQzjPG28tfUnrL/WhH6sGD6nMIVBj4br2foUwGOr4us/aEr2Vp\nzV69fl4QipiO4PhBJOjk4xKdol49cSWIIsMRq3riV7xH+gxtg8UJQvzMW82W\nADzknclNjW8EAyy8rwoiYZDZCt5pk1z296iT5AO4kVqax27iSmyMUtnbaaL4\nlthL\r\n=SuZq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0ef6bf888f3c9c66341b275e54613173c290c652","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1899"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1899_1606224662534_0.47753016929177017","host":"s3://npm-registry-packages"}},"1.0.0-pre.1959":{"name":"piral-pwa","version":"1.0.0-pre.1959","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1959","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"be988f51776a624175ffb53d5a781ffca150786b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1959.tgz","fileCount":25,"integrity":"sha512-/OiC1IZmVXSiQhKS3GmNYl4wyDXZCHuuHjKFT9oseUuzuW3GVOpEjOLbB+sIu3eos40LpbhA4YIYwcHfaKyN9A==","signatures":[{"sig":"MEQCIC0Qi+MbGu0WEe/hzCKRvQ+e8rlG2QEP6Oi4PoWTSzxTAiBXN0KVOoPKAgG/p4KqGdenMwVpdDXXpyd5EyFu2/UXlw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz56vCRA9TVsSAnZWagAA0noP/ibckCPnESbnHVD7NGoT\nOmO23SjJ5lDnw3oAO2NH/71XDj5dQickvS6wrksaH0KGGA/0mGBSLcL9LZVj\nMmzQUwt5T8AkknrMAsC5seLitwYnG/HUKy4376l06kBHdw4IAUbURnNF/jRR\n88rAn6lEfBHUBTAcToAJ5QZXO7EX1t00j/a3HjUg2QqqIW1lCTqg4Pka+xvy\nLEJJ9IqVjKqdb7qTrNOz9cAOJm/+6wV4pinFMw7JIwoqvOtnDihxnwpjjrF+\nvQITM8vsmiU5Boed3MEjLFYnb/mt9zNWUi/RKNYOPZ4AVtln7lNaUuMhjjc3\n9ERCxkt0WKDzB0qd0K1W8prt8F9wXuyLHbN3RYF3t1HQ+WwMJyeOHyYIzdUN\nwE4l5t/Ib2rMYNqczcxy4TAEcbb6ux7dH3pdNeZ29AmF52ykByQ5/cu9r20o\n77mLklXCY4F8X8DJ+SYpIuLIcDE0MHwMxDNWzTzs3kz4/+2VsqY4HrglAu8B\no/QqtOL+HskXx+sV2zS0TAe1X37mX1Qsnu/8kQIZcWjN9THwlYXP+Vml6UIE\nojncpYLYgQg2gMN0dSKsGoIDpFwVehgVRDJ1fKzhpK5OyRuUfwo48HvrZyvl\nfxQ7JuFr3cfNeQHAEK/rOqfCUqz4ZEPI2FGEooN74sTvNRfbeeExdubenSkX\nDNwl\r\n=oJWb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"333131723609a66c76b743ce322542aab1e650a9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1959"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1959_1607442095146_0.6347892694688713","host":"s3://npm-registry-packages"}},"1.0.0-pre.1998":{"name":"piral-pwa","version":"1.0.0-pre.1998","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.1998","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8fa0b9816de837f2ad3674b93392add2619e76d0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.1998.tgz","fileCount":25,"integrity":"sha512-1ZZAwUVAPIwhu9vknYA/MEnCSdpFF/4IN+BMVlh0s6FWldW3mH4xlZ0ihBpA4uy6MXZ7vtn+TWAHAEWn30Ijlg==","signatures":[{"sig":"MEYCIQCYn2ATsdTCczpVgP3+kCVTUtx68A5Rh3IRrq3v7tcJMAIhAIkZ689VFj0reYAalu4wwfmJvgko3rubQGojV0cWmtl9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf02PuCRA9TVsSAnZWagAADjMP/jwd865krQCb3HrjzHKN\nN54IuRBNdhTEsLumCbo2oHMF5FNHaHvT9fUrpUr7L2KuQdaCZ+b2ZTh61EBW\n7/WJDKBZDeQ+aYRgTwN02atKXZEP93aL0O6ELArJ00Q3S1+wdpyxRRTcyPj9\nVBKpPax22rzu8bH8mcjmDY/udjH0ItGukwHdhaX3VnZTqFo2UstNDStXxrCP\nrrTCwgH8De89iT6zBAJESgflv5fIuCniLu9fyOBRjHpOIhLyQjiYUzXoHKR7\n1XiCyT1N2d36PUS6KAcGFq3zfsVdzN9CmxEnFi4EhHixb/YHi+/zKYIRNgdY\nIdM9NKaFAEya5E4jtwyfaAAZ6cegRURT5CpI3ZqbFIGl3zqptwdeSHwVIfUX\nmJAqoD+21Bu71agQW81BVu3xyZ5hn97cVL/L+LCxmNtDo1GQVWvGtfql+958\n3bRrBOIkYhdXA8qicSZcb0WOIwlUitPtlZVw05qbkJQ81hJVqlA7YUt3DSv5\nbWgOLYus4NXPKUJYyFFH9AzRe/LYLVx+0P3W6uz5X0wEq1xvAXfFHBSp/Ta5\nFN7127poWOQTnFX/MRmDdCqhXvcPIP0EpfRSQRqnnU3nzsadZNn8Jz2tY9Wr\nUe/sO6BYt3fCUQ7ozZsOUIslxja928Qlkkv23fSP+/F4qffp5eqsbDeDlbQI\n4h4Y\r\n=iYGf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bbb2627c1b96262a6e3082d393abe9e324e3829f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.1998"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.12.x || 1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.1998_1607689198469_0.06150964039772888","host":"s3://npm-registry-packages"}},"1.0.0-pre.2025":{"name":"piral-pwa","version":"1.0.0-pre.2025","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.2025","maintainers":[{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"},{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7f51603b96967ceb552498b4d1c353f2f4098d0b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.2025.tgz","fileCount":25,"integrity":"sha512-tRX/f/U6LH0q/4PkpXPyy3OGcCOUiO98lSiWP7rWBIFzl03eVlg7RFvryyk/t9yclXEdDNqdOFP2Dmfgft4LqA==","signatures":[{"sig":"MEUCIQDD3qX2cJnjHf9t7sU/LDyr4/m/pKdCNXbAXZLiNLJQJAIgR2ClGgdw1EZjjE643uOL7abdtn5jeLKWLKb8AbQEnco=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1XkrCRA9TVsSAnZWagAArX8QAJrsvOfwqVNUUSdUiY4Y\ni7F5AxdnM4sI9lc9DnlUH9k4OFm4Y8lP9O0fKVdGyArIH+Wvo4ce+s3HWxmJ\npt54XRSG0PJTTENkOl6hVv8wr6jQxwtcJoub1lzU0KdPfK/0DNhz4FxMkVY/\no4LBymBGOlLOggvKgKqgt8Kxv1a4kNNsEyS+boTrW6VHgtzXbvZI/XV581g4\nywpjWJCWQdYoEIxw9nvaOgO3ZOQ8xRmHeJ+srzsp6mR7W5HG0Xc9kZArhPuZ\nYl371ZzoMhkWlH6fd9J80G86U14A1WSLwIXrcrA5DJ6aHI7W8j5DvvmdpdNL\ntuPAhOd09Yw4jsPOv5wluzWBGpLM+qC3gSMJcK1jK+hWj7etTKCXTLZDENlB\n3pjIPV6n6g4rAIoGBy1SS1dFyCB8RCjCQRrnf6RZtx14UylCnZXMHTz2FS86\nviImGdaeDw0BGQzFHXuC1/a+Aq5+IgFAG4dKrNcN+mkJ81q2DCts6nCxe/tD\n1s6/guweY5Y/QGEYBU81iUN8dIutk0Ffk+px21Eirzp01jy2InI8Bwxp/DxK\ni+Lp21upMPUY9MMYFSeHZw36okbaeOxA/9rbCMwOtlAaAEwNN+yxAZeL2UHS\n+VcL168H1uasb394BTYyVRDaaeg8SMjQa9uyybQhbgyrjohiwwR1whwHvPu+\nsqKE\r\n=uH4Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c4c723952e67352c4a737ed122ecfed90796575c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.2025"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.2025_1607825707265_0.2033465441346365","host":"s3://npm-registry-packages"}},"1.0.0-pre.2028":{"name":"piral-pwa","version":"1.0.0-pre.2028","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@1.0.0-pre.2028","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"99044f4496d00fb4d57d9027288bacf959f17223","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-1.0.0-pre.2028.tgz","fileCount":25,"integrity":"sha512-CpIFSpjmRpJ3H/PNGtiBxsrtLW5EmoHVpAPlRfuw/ggv4pGcRlzolA/oK4Okr7h0Qd6jxrHPd3+mc1zAi/CyHw==","signatures":[{"sig":"MEYCIQDlVp+PsJudWPOlHmU19hMWHHkubDsBwGs29Lxaujp/aQIhAOHrlTTQmkQuij+GdyQHuDnDCikud1fyOrLGbtR2ZQGO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1g2GCRA9TVsSAnZWagAAcHcP/in37Zv4GN8Ya60mngc/\ntP/li8Q+IVs1jB9LC7YfB+jFN1hDpTuUQW0eXN+laUzpTfuT5sACadu7eYBg\nzFzQPqT3UER3fV3jH5TZROwWRTzxwxn+KQC+QWNnCj0PYGmHj7tTmtGgtoeZ\nLxK/p9Dlyq2dCOYKQ+WtWyVzO8bPu3hmStl0egYiE/0ChDCTcHog5TQ2XnG+\nbLLih+J73fTBVIyNJeNk7LiOgxWuRf31sbcvlODH6LhAtCQoB7mDYACnj9EF\nHT00uIMpu4GGHz4mTGwbDLJddab/idF/tbfPOi/XH6XhShHXOk5FsUpxGWYO\nnvajygOiySoxURychebdE4YMnHFSGynzYz82pl835mDBhvG2F8AqvBWPhbj7\nMWr6f2xGFM5D4DCkPakm6+lKbvcJjDGfq0yizppjEhT7CUODPt+tutgRfDjN\n+UKZl+J5JZE6qjDk54duP1eDxOeB/bwfkbV/doEoQIf8q4ce1MBEneHSNq7x\nhxFL/fj81yIB5T5wGKqZ+RDNl2Pneg/UJNg4SBzFmW9+mrFtfVgERV6zHuXv\nmV8Wx8hdL4YmSvdUyGOwBbeeT5ppAUh36zftsjVRGj5nOlw2WyCqvLp+gVtr\n8JEMbLPk4BVvVTUbqLiMmu1t0zakw9qliPJTOY4m8+cLOi+c+9XZ79dM+Qa/\n6OTd\r\n=F3HC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that only has a peer dependency to `piral-core`. What `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8b7cf279cd0a2b73de5ba82d6d0c1143cc00a56c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"tsc","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\""},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^1.0.0-pre.2028"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_1.0.0-pre.2028_1607863686359_0.9337628139612455","host":"s3://npm-registry-packages"}},"0.13.0-pre.2244":{"name":"piral-pwa","version":"0.13.0-pre.2244","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.0-pre.2244","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"03dca014fda3ae071a398d620aa9ce53997004ed","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.0-pre.2244.tgz","fileCount":40,"integrity":"sha512-V36qfYfOgCzpu/T8EctuPJrtSOtwsCSv6N9KURGbv4ZPxvYWxb4f6UmqwkUpnx31U1Y+QsGBrduWi/cntFSpeg==","signatures":[{"sig":"MEUCIQDqjSMSMaSyD6QgL+P3mSPZuP36a7kQdD00OWaFf+7LEQIgKcH92UW0yFcNnQtisXEZbdan81ZpHYUOhhv8tDYNfik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU42nCRA9TVsSAnZWagAA73UP+wTkVO0X9uVNqlcPmCfp\n85HLLBNv5mL5kTZvkOud6mBRWz859hV/NMgxO4hTN4nLZSS1iSr0UpcZEqFX\nUAuYHU94fk54m6xWf2H8X18aWkdyc9oavvYKQxRSPG3ElofIZm2MPAcgB5ar\ndokEaJcUF3g/mrm8KkJHZQfG/NPkhDr2IElOX84OHlm2cXSNTLWfnGqtANbu\n0B1UZb/e2TPPW8GjXfFyX5vuscOIzyC/XYE4K3gSw99PtkhUss4IiAvXUg4L\nMnFGq8+55GQxO48N0nCE1mg53y66ELYG/BlE9Z7/G5D4boJrI+bUZF9TKAWb\n8grnigRYXkBUP1CNAfbaAaWn6cGgHH5QYcwbNaKTZ++rDVr9cKMkiF8sEdZn\nJo4ffbVxdaKN4vtweuD80Asv8iAclvtl7FgCS7zoCdEEHrzREAsrbo0lfc2m\ncViMLqTzILZg5UxoP9x9GC5M8SSP8SCVOCf1E2G9DIlQ0rQK6xi+btM2I80H\nvDN53EnzwDApEboUyEinKXP+6YPUmNavVvrbYOUSMlY6x/R8On4LD3KCUJab\nQNJ3lPmUHYwNirNed2eqD87nghTi099W/hrMTPS7Q0EHhm3+Ujx7wfM0Nn+b\nNl+Cj1LjXarp0/cARrAakxAlAAws7unT/Qd+2gI1CRjm4baik1o941l8GvkJ\nV+RO\r\n=hRHZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0fc650912ba35ea5e826c7fe4e70baab7d31c171","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2244"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.0-pre.2244_1616088486670_0.15244885566113608","host":"s3://npm-registry-packages"}},"0.13.0-pre.2253":{"name":"piral-pwa","version":"0.13.0-pre.2253","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.0-pre.2253","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"67bae66d812b300551b46859fb591de06c360526","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.0-pre.2253.tgz","fileCount":40,"integrity":"sha512-VL6fQIeZLM0pnuQObqu5zNyQH2gv1COzxRUFa5eOYXf5oQOPFKCiNwSqPENewyDGO9fiusF7j2KdOOvxipsLtw==","signatures":[{"sig":"MEUCID6loZRfZFX119L0plbuS89UFdu1+8eAWgYHkAsERlVjAiEAnOu0OTaLjTWAIxp3nO+KIAGJUCK38vEJ1UlasIRTEso=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVUUdCRA9TVsSAnZWagAAvqYQAKRBy3p42g1dwu0YO3+x\nqrtPKnKQunalYYEGuFPwGDosyEUx8Al7i1f623tRz3HBtak3wW6MndV18sGa\nsIpuD1moVWDjhQn4+SdJy9lJ4t+AN7Rq/llD1hLxOFZcefW5RfozKooszJgg\n4QgW4kpWCED5VZ70zrpQS1vphUhmVrpgjnc/6IM5Ycrk2NzUmHuoBAeQWABD\nnC770RKip+WgHtSXtTPqfFE8VQZAouSUcDhHSKxrpU/N/3A17mWM42z+8H3f\nZCy9BRE+larBGyYRVWI4ibgWZBUf/uNjvUTbEZdvHp6S/u/F7K2wDF9fiNtC\ngUbZG0udMe1l9QsMkGVQvTXyDvwg1Z6hI5DmLm1Oq22XBvOjAdqruNYPP9Ch\nMFXtvvY18uf56zMgeZEt2pS1xdQ8DPX9v77CysyKkK2pUvTV3724pE7TL1DP\nRczj7XX+9wsthhDdoy2mRiyzj+m66HrIxlQ57CCBSDS7TI1JkKmbyd7foDya\n11RIi0DuBrTCRkRdrYqi+sJz9yszAHrrbuFB7Sc/mANhn2SKPeCsKtGN4Qrq\n3nObkxOtTRX1qqYbE1e2pwVu2R7QWB1QfFvesuv/Gv63yRSmMDcqL8PVEL6U\n2uiy2ICQgpvsF2m3t1mAauHxBCRM6HLNMdHdiIJDoEG8ZEndt+6OcBQmFvBC\nG0PH\r\n=RNIF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c3bdd3a4b45d81a1844f71314298402384a8736b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2253"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.0-pre.2253_1616200988363_0.8075247576162448","host":"s3://npm-registry-packages"}},"0.13.0-pre.2254":{"name":"piral-pwa","version":"0.13.0-pre.2254","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.0-pre.2254","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3f1cc666df55dd43b91a2f9d1251221553713ca8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.0-pre.2254.tgz","fileCount":40,"integrity":"sha512-DdPhtjbmlfLCXHf0yVWpxjw16zv2BloyWW1fMkL5hAKUC7TwNXcFxbN0cHeToVsNjtx8vCOmd/ttCatRIGSc+A==","signatures":[{"sig":"MEYCIQCAQ0lPiBMsdHBCrzeymbx5oAniio3ILj5aXYVCWOjI/wIhAMbbCoX0otKzd74+76JonpfLyRIDMsy2tSACr24NE+Ln","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVf3ICRA9TVsSAnZWagAA6RIP/0hEMxEoptk0JeXkmaPf\nNJaqB0g6OC4kR/OSP0uIIM9G4wVe82KaUCGgxGw75ngRt3PSKaaziPTaeXSh\n8PFbYknOAmQqdHAfxbr0YFTccGe995SG0+/WErJkJNBEQWeGkDhEiwTZFqpl\nNha0Q2sU+W9Bz+yBzRwH98oDbN64rRz9gUGztSOKAUegf9P6hcVM2ORa4oVv\nrhKcND05ZKdxeQZov/cuT1U8yAbUoURJyYvzEFwPNpAoBHga7gIevCeJsxqs\nJbJ9iMaLfTQNsp8KiLIte26ebcry/BB3F4lXNfO9sgi40yzbU3iS4PnHNol7\nlZkGuQzztHc3r21rbJn7cCXdAKIm/mGcJL8JCV3ObEmKlamwFb1tHhSKpuAP\n51IR1VS6Hshm3tJdSBKB2LuTB8W2TwUtiuwWTNFxJTGc6BWmhj707BMsKm1E\nkq/rUEPaQIjuGznFyzF105NT9m8CFro4EMLa/Cvc1f0GPCfvH3M7sVMTzi6X\noqBcOv6l2zNaRm1IZHcbqBttJ+K27qMDs+vRD3nDeyX+0VSZjiFb36bI1Uj8\nby3wSPv6NfYStbPjd9MFhvVh5OLOaD4Z4WZ6QMouPmcLS0M5Q/6biKuQXmsy\nzPnoMup4z9KFF9RY7lmEsD9Tl/aT8N/01/6PmAA3Vqjgtqt4YvfZ5ARcEcKq\n3E1T\r\n=yJA+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"915e66bdec60d70e939931bb4010334d23498d1f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2254"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.0-pre.2254_1616248263962_0.23369219519168172","host":"s3://npm-registry-packages"}},"0.13.0-pre.2284":{"name":"piral-pwa","version":"0.13.0-pre.2284","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.0-pre.2284","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"597b40181fb6796c82f51f0688d4e1571a6e641f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.0-pre.2284.tgz","fileCount":40,"integrity":"sha512-aWJTr/yuh2ULfwMxyAQMO77YIgca3DimaXYauNQyANAzylZ3S/VvJ5Wo7lTrB2fmr5VqybcX5FEDo5rJ6q7vfA==","signatures":[{"sig":"MEYCIQC4qrbYhf/Z5LBJ0XQsmLE6MAxCnb2hvyn9P3g9Rw20EwIhAKqjqYxvGhi5DPYXYPdQffNr5cCGWw6xenDwIJrp/M1k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWhleCRA9TVsSAnZWagAAf8IP/1MvUSXjkdhZkEJuHvLA\nS7Df7jxTnP4jUnuoU8c/dUBxU/J5SSE/j5E0fiZM0lI1sXhEVen1rSRUgs8d\n2GO/NBJsFPY3uEEGHccZCXqirRxmtRvyFTAPF6BPqAXITXfbs40AG5WgrkQ7\ntzMu2ThK1z4b4sY46zhbBT6I8wZfbvWSKR3j1P53iKbgkMwffaJSPKOQb6Tk\nrg79EdUFJnH/rmvTtou3YmKmFJcNMAb8zVNV5DjJQAfN5G4j14s/x3+O92jf\nC7W2vE4PJlIxu0p1yhHnEeY+DNAfazt9MXDl5ns9Y16FucxMsOf2En77jiRN\nWo6yTVGHMTOdxsihxLdQn4VtVuqf//Q2T+cofsPaRg6sRNWTqSGQmo67kKEV\nMDQprg8JvDKDKJr7q3AW1QisbUf5pWWwKCiFTGefjnbWBig2ZEp2NJwvVMUI\nmfzLziPiFol4JEjHM6hr47Z1RVGXnbcnseGC3s6k+DJZwTcjeuo3jIFhxJW4\nGE22rfVrZGKfUJ0rFjQcfqUp2AplwCHJTNO/L4TBlfIAXsnGQvvYJzM9FsPD\nn9FfK/D29Pozi3DZmsk9QMlVGZgOwV11L5VWnnrsAf0jqSGdp9Pdtk/FT0es\nlLE31FxyeVBeRIPe7J/OP4Fd4r+H55ei21+nWWOw/mJLjsvB1s+6dUuIGqBr\nqoVx\r\n=vw7J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3b1a2574193c413c7b67e83657c878149a410f0b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2284"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.0-pre.2284_1616517469860_0.4108985267841758","host":"s3://npm-registry-packages"}},"0.13.0-pre.2290":{"name":"piral-pwa","version":"0.13.0-pre.2290","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.0-pre.2290","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c5c1a3f61cfca10a85c69c8d008780b8e02f8752","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.0-pre.2290.tgz","fileCount":40,"integrity":"sha512-wPqQaEUMqYtKYqoIvrWif+1OCk3V4IObqzVjKESIbFmjaKDRD8EjAzFXRzMh8ypOBBlXTApvu75c278zn8i72w==","signatures":[{"sig":"MEUCIQCgPzzez0kJdSzuo2BLo5rGqIJuJx76rYy3ey5dMHB/8gIgOUJ5WuFqHmXL9tJee9dpqi+4K5ygfkrh1uYiRtFxdIo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWlJyCRA9TVsSAnZWagAAeAQP/3+miEjXJ9gGgWyeCEvU\n8u959D0MHayQskrxfjWx0NvYrOqV6kdBS688qBTADwGKAh5WVuMw2lrcNMvF\nbWpraydqJYZzUHVh4TXdWylvF7e9owGPCEeTv+AUaNB/ap3SM2pX1CyvDqQ7\nVjsljF3bJ3zY6dOJS18FyX6lSmZowroEMS5uQMTmC550tylihyyp6C1hY0gO\n2JtRlbcP7IktMdXXVhpLeOfsy+KO/28iKJeYIhrzteZQn7LzFvfAy6niwvDJ\n3MiGa31Z4gwPIeev1TrgxENQvOliX75EqLf5gTIcIVqrvJP+udgDjGiYQnb8\nrRYvpaOWIcWr3ej3aGSB/ZRpu71/+3wezEmYoUlkrB24pA/9lRCJeiPTPfQv\nwmGz8c7wpnLB2nGEs6m7Jv130bD2q/wSbOJ+CvlQKt9yUIqb9JBDR8jLBVeo\nvOu6ji6OVG35MGIfjv+kjKzuDTE8bcCeNQ8s0TW6CHVOwJ/++MePHXVC7OiI\ntsfkpNje6f7aq5RBHFcconeoD0hG50Yxjykt4EYgU3UQEVWx6lxww26XIDbU\nYnzzMOaM/0FXH2DsKd3czC54/sRbRCXgWIJeRaJri4k9uFzYB+WO81DRC2qw\nPaGKHMw3Oq1CTcgWmJdEWaD8OAeGDRA4fyt7LvXQ4Nb/dpIQ88zqssz59Bfs\n3vUv\r\n=3KOT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f5cb5b48fb624f6b9bd3afea3e24534f0d94b3eb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.0-pre.2290"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.0-pre.2290_1616532081642_0.9376465746431994","host":"s3://npm-registry-packages"}},"0.13.0":{"name":"piral-pwa","version":"0.13.0","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"03f8259e7bdb142bc0c1b60d98892b9f2a842e6c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.0.tgz","fileCount":40,"integrity":"sha512-fhzEX8ubTe4mHWQWni4iWiwUJdDTsRyHEfPp684U7wCteq73D2w3+Ew6qhTJiFPJ9VLpW04fXiX6+ZHbr4OFRQ==","signatures":[{"sig":"MEUCIQDfwxkz535e3zLfdo6wQykv1Oq0LV1zAIata0eJyjDsoQIgFVsS4ta7f65x1u4/N9SRbLMNQ715treNS2or6RZamjY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWxKICRA9TVsSAnZWagAAAV0P/2YAp5//dG5ey+GweLSE\nEIKv+WEFH5kqGODVCyqhbnGWgLC3Z4AV1uWAXTyySzufWskRl0R3WgcSYOHU\nTczTZsCd1iDzX/cLL0ugLhzLW2fAIeL8H7Zh/1xvtakeREpOboSK2JZydiDU\noHkBDQK50eIjqianVNh9jk81uhLbdMkoEr54Hjq4eaO5MqnWBM7XDJK741x4\naudzHemns1fSB+oB6aVFZhphpSzC+I5lx57laQr+mh1kGrX/pyEXVzwz710V\n/UVJVDNYHK0ZkHGrtfPzUORGEqSY0N3efX0pfnv9e5xK72JnsBARbUzZ/8tx\nSYDSoGlfZhaVvJwwDCzEodn2C3pOoFK5rCN0MR9DpQ2NBr9QvcjSmrPYn9u9\nlGJbHKvbcxke+3CCBG7d/4ikQdHVJgy3WmChBixCCtyzmgkeakX/pwW17vEu\nh1vl6NNTY5ttmr8CreKXNRyDDqI0++NX5vHXDXshu8qLcPRKYoPk8t1gjOWY\nQkGhPwc432VBlTqQ40Rqm0nMWna/BeFMis2oWsKNlBtBb6odJOjf2Rw4DKJp\n1LjVVyMuoFSsBagKxJVFqRLz4LM94jbqhNUIx0ylgLIvQ4iNjUtTBdimYgjF\nq27fCG/88yypVwb0pYWznMYhSruHo+1Ht/s3RKDAYDa2d5am3z0mwD2C+mSb\nKV9y\r\n=RQCu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"a3dfb71b2cf1e67755e6a3fed0784c9e8012280c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.0"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.0_1616581256470_0.6452004152681716","host":"s3://npm-registry-packages"}},"0.13.1-pre.2307":{"name":"piral-pwa","version":"0.13.1-pre.2307","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.1-pre.2307","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f67a18d206e758575e58bc15d697115cc8334c47","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.1-pre.2307.tgz","fileCount":40,"integrity":"sha512-i3/JT/SKnZxtaH0n7ZV8KPOAjAatrcKsrsZY2OlznIS85ChiyaZ1cby+/kaEKcJkAAUIVJ/9F2W1+NY+nXKg5A==","signatures":[{"sig":"MEUCIQDGvkKNH3IHNrVfvAYvXp5dg/HgklBhtWGK3toCPYMR+AIgHNuMtYFTkP8IXMYFoF7bFOuXDxiXID9lsA1gBmjyaIM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXMZsCRA9TVsSAnZWagAAiNIQAKRytEEj+FVr7fATGZ3X\nVZrT8ksmN27CJbQ2MhLswrsbsGovYM9wPFRC768NVqhYC2bX4fasclipP96D\nhXwCTDYg6NndatUtHQNUx6cHgdbvsdRBbLaWiYr+kcF+J9cAXh6aD1ukndu1\np+4VbPLb0otOej/a0p3MKnWf633TUaoAM8ev5qA3qRWOSGnWCQwcB3d1oB5F\noQWTy/LLK1jiwP/LA4Gg/LY9Hjyd6+d4Vf3jbtCCRJw5mEz66zneo+iiXkM8\nZur6Wpo3KXE79tdy2FZLcFLLinVGDLvk0oBnEAuo3oUfh5T+2YcEdTVAtN6U\nyGTdJQAYaTxMyW27xZVS0Joap2NcQ5G05B3VVBCB+YDd32NLcOUUgfg/8aXd\nNFFy7mzBimjhCvd9KctX8XWFtTjum6e6dgzcSI6vxO7ZHr2b3ztKe+vpfxFl\nVpV94V4UVQ3hhbnt38EYiE2cSawlS1OBDESF2ncjuKZ7snrlWRWTnDUAktgh\nEdM9/3CV6BKUFGkKod7e1mqfxj9Kf0vHlFe+vDRPuJfOxG8wmF1vbtn3L6LB\nyocvsMVTfObQv+EfoWpQpwMXiXmGjNfW2f9n8WLFtDoAEWcagMvlTEuaeF1K\njsr0yNA4vV4/KNd0pzWnIzIOTqqsGP4kTS0GEprY9D3R4JKi2LAmfN0HgBCN\nX/C4\r\n=ekk8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"58e51a7f4c0acb05117d380aab6788f2eb965580","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2307"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.1-pre.2307_1616692844357_0.7907513921851645","host":"s3://npm-registry-packages"}},"0.13.1-pre.2312":{"name":"piral-pwa","version":"0.13.1-pre.2312","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.1-pre.2312","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ae31b3d67e1d26e354203bcb775ab76d6e7e68b0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.1-pre.2312.tgz","fileCount":40,"integrity":"sha512-LHXKzqKs53PzgjKoRfLz/v2jtDfkLWyvcnkkVE/ScpIOoOpQqNZ/cTDgX3FzSSY8H895acD003nls8xka0kkwA==","signatures":[{"sig":"MEUCIGYqG+wtnn2MFFLncr6hUJzTsZBvyPUiMEU6K5ddpsk6AiEAwtfpApV30SSqCnkzsAg4Ehbi8elR1qaKICh0W/WyKqk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXfH/CRA9TVsSAnZWagAAu3YP/jZMvDLJMMYVGDmj9KqP\ntgZ101/rQJPn5rNyU/EP9BsQTStTFPNF4EgcDW2h0uwUE7WC6BY2I6cOEEPY\nYyHYXLGfOzI/KGhWF6hto/oFi3iJwRaJu9PCme/iKw7S19fKtEpu+DLl5qbJ\n2vulHMr4nsSrgy5SthtEJS54b55LEmibLOBG9roVhW6jTml4WrXpw33LqLlg\n0FF3P07U+z6NUXlLsThShBnQeQRI0f7CdtZThVviLFSYHEZZmXbidxFx/orz\ne645ZUI0g1ldI/GQaXC8cD/HAjjVxXun7tMyfMdHLbN0fFaKDt389z1tfSYY\nPQXeGkWbLpqTR4MxuXkEPcOzTq5nSTUpmZmCSopxIA8fVYLA3NC5R3QVNDKC\n8nkdMX+kVboPj3y5m2e3Nc0ogRCspbV8D0SNuXtZBbp5wUpeJib2rxIpFQWY\nhLRECP2WAWzHYLU0HNR4DtTzD8wzeQLFqWPEUJpVOWfPM8oqMGZrRZOgSvQX\n1TgdWj2wgK8ASouGenD78AxdADo54yJUFNbQ9VxkYatPWvjY6CVsKLZCst12\nJ1Eo2O8B9Ilj6fj/gmT9IY6Q46yzqK2Tn4fuWltAN4ZdV3arT9C5tYxTs0Jw\n9mOAhRjyTZqIlbh+buZSZFfeQj0Tk1Pl0LLtFOwqDJSSHiW0lkqvsPXtENCP\nyWaH\r\n=Y4QV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"30828c5195ef70d3e10dbbf23e5569ad2ea1168c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2312"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.1-pre.2312_1616769534623_0.5544999948802618","host":"s3://npm-registry-packages"}},"0.13.1-pre.2323":{"name":"piral-pwa","version":"0.13.1-pre.2323","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.1-pre.2323","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1bc8163e441322e8b5fef02bc0c449333f16f2d1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.1-pre.2323.tgz","fileCount":40,"integrity":"sha512-XfGCP+4CqsdQgDUm82USKTJ/aZVo831dYwqKNCCm+sxYsvXAEopJswh+c9WsONpKI8uv+grdePljC0Z2qxOfMA==","signatures":[{"sig":"MEQCIBAmI/UkgPH8bfaHZvCmV1kiD8kd2vZSQLLKGca/aiQEAiA3TmQ/GRMoffLVAwidmrLNupuDrip2sb4i3n9yrusqBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYzLgCRA9TVsSAnZWagAApI4P/0VxgFtHlWtH0xvpN8ji\nzZshQ5wJ+AC8erOo7ECos7i2LhqWV3thIo3oqqV5/jiJfpjOeTnZSD3dWB1j\nt0k5j8ySZf7bvqrW6w+Rglf7kVvnDPM0gsfSCtJqwwhgh3NBvkSASKZcsD7I\n3fxjTBsX8MoqmrO/EQOeRhRpvM81LCOAPa0oE2K8ZX/mcYiQxUzg1rDe2NnE\nbgTHf4G67RXKh9tX5XpmN8eaKCtSWd0/lrtB3yOYg3TDy/ivA5fRJ2H8cEHQ\n1WGWlDBl1NBMcPa8b0cwMNLBfHk2uZAVlhvPs81ZTEUHHteqnzfpRbLoyheO\nHx0l4agXs/LrTOuuo98cQ8nW9gEc43mlj4PDghWg1uLIy/UW6YNm5dEfTdv9\nZgZf7fdrWmY4gfmKisgGXDwTKOk0n2cfMBWCivDrVZ9bwwaI6JsAd0ARt9+Y\n5PG3/cKhIh6xbTxJdunK22g/BYyx7/n+nsxlzgDuayz10jd6XdlQ1LGoaZJ1\nILIiqnPClhBH72+e309lJ81VdQjQr7K5/1gX6THtG+LzaVqc8f/DzZAZ792S\nMDOj4zo6y+aWz2Gowp289yjyoNa1KXdUbz3jVhFWmKfaTMPiBNcpjPjv5juz\nqdpmY8uDj9ibyEFao069QbZlAQA5ZRL7sZXSAnbvJth+8rE3dlQ0mYblGJds\n3vEw\r\n=ow0p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9a196b66a29c4fd0ba09fd95382d7340550443cd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2323"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.1-pre.2323_1617113823827_0.16957318771403096","host":"s3://npm-registry-packages"}},"0.13.1-pre.2326":{"name":"piral-pwa","version":"0.13.1-pre.2326","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.1-pre.2326","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0fb481c042a71d6ac3e5589da7640df39a239e31","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.1-pre.2326.tgz","fileCount":40,"integrity":"sha512-es7kgeIChwTbe8H4pIY6dPsWuSUISI8UqQBr5Yyxf8ut0ml/RDzyKCqzhaC//XPlmNoR1/CI4PLSJgUPzR0Gbw==","signatures":[{"sig":"MEQCIHbQpaahfU0sPqJ3XRZdvqEQhuGogdc2CHT4gn+wTLzeAiAtl/EQ7lXwFY/oc2IJcZdboFEiCf56w733NSuwMsxfGw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZFZsCRA9TVsSAnZWagAAZBcP/ipoxEqgfA42Sko0TUNt\nIwf3K1UsJyOTQZyjTmlIaXEimtgxDyzQBM6Xf5SwqOufYAAF24gtvFGhhXW9\nhoeJSR9PZeJf/5i2gI2LUJPhq00dGPgZjWMy4kFBWycm/rQGe4PhNVumgrWi\nty2k/f/F0riW4r5kqoMkOJGp6wwVHaq0/EXYL0HYomxKeiqV0HsdmJYa/ah9\nYj6E9jj9qZn1kFJkp/66q0+OmMpff6gII4P7tPWrP49U45vVHxbAJKc5/l5o\n+dGk5vhkkzR3JVgKE7TDHaQYbc1D5FSfhm+t3cZ83z2d3KxDyqyzgL9Z0JPu\noTzo8Xc90OnSKKz0qh2pyJl0W10U5vqIYFqq/ZVZ3b25dK/mXXFpd1sW93SA\nC4XVDosiV3c2NZ182jnoYpkzpsMNyGlsnW0Dh4CzzuOo/KDgXbxyjd3mdVYQ\nxv/QWOvBoFhqgIxB6LwO4p767tTrqRfJUOzqcusArzyG8wHZsfgnJLINhy3t\nfoiCyo9C3GM9PwyD7sX9vGVamq0Y356w1PvQNU5SatazvJrxvEVg2Nk0hq6+\nt3FcJGIkzZPDbBc3Fiiom5UdWuGMuqtCAW+LAWSBwdcK9vApUFXr1oqy6OPE\n02B15XC8zjyMdx1CBFEJ3BinIiLhUakvFTHRpW8oEzEyx2tqstE2x44B8VpO\n120z\r\n=Uw5G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ea0e572e5985084152c4ce824ae3102ed1ba6731","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2326"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.1-pre.2326_1617188458568_0.7016183132765776","host":"s3://npm-registry-packages"}},"0.13.1-pre.2329":{"name":"piral-pwa","version":"0.13.1-pre.2329","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.1-pre.2329","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6775778e5c102e6157bf3ae3eb1f9764c581e698","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.1-pre.2329.tgz","fileCount":40,"integrity":"sha512-Nr8ZnIEHCOI4Y7P44rt7UWAw13IQwyZG1hESlP26YBuKf5xsPHOdtaI3be4OtxhPAIxNhkjZtA/s6CcDKItZYg==","signatures":[{"sig":"MEYCIQCfbvX3o9jgBJSCOXU/VbfjE82diYmeaIAF2RRfs4ObsgIhAOV794jPATDeJy1nNRY2MysbT6V2g62zGHvysINLjzZB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc4qECRA9TVsSAnZWagAARBMP/39FUJ42EjPmhyzJceEG\nRSffTGqrNWgwGwxLtpblerrqUnbkM8OBCSCPyT4or74nDBAqip+cLbJSf4Fk\nsxUuVc28m3vXQPq8eDpiAjapvhPx4+TVbCxSjVLtNuMhUrZ/4CWxn96Y9uEh\n8kangHbeJjekHWnwAgsng/CdDDluStoMbqrbDqx+W1c6Na8xZ6solLvs52rj\nRnHxnCj9pME0NaIn6UrcCPO+/TB/IzI8fcrY2tZf8R7dYcMmVdvRn3LxeRYe\nkd4ltIf7g5pMtKAKFrKGduE8zbPGDyf9L4zyAuaaDugiGgi7dD86bPnUh4jU\nUtAyMhSwj/Fw///Ags/Bwj41QDi3cFuF8ipBSg5FRim0xmS9ng5l1xZ/K1KJ\nJGo/Ms9Ze7lI20GRHGTbLTMFOxCzAmFUV0aJsIC66gXOqYC5ZDa4x67CuBnn\njt6GYcAR1DhZJnRwdOl4w3HuQPNTnP5I7qBe1EOLJ4A6IFbrHYlmkdbTUmjx\nDTDihQVZocqS6VfDc1BBGXvffcMAFT3cB4l2IeQfCw5JUL9q0UEteLUqtlEP\nM0+rcseHCQes7uJxFRfyC2aLQD4u5Tq6BBhqrMTZapbotBe94w/6jVBYb3oL\neKQ3T6gijg2LqhSn5673yEenihrWiFpw7cVGQ/yHvuue7PKzmspo0wM1yBzK\n0Yjp\r\n=j/Z1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"483fe6bcf7f522fd2d423d4d4aff680cac16cd46","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2329"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.1-pre.2329_1618184835981_0.5096235254511674","host":"s3://npm-registry-packages"}},"0.13.1-pre.2330":{"name":"piral-pwa","version":"0.13.1-pre.2330","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.1-pre.2330","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"71dbc2d6816ddb4fb240079d8e8b2dacf8bcfafd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.1-pre.2330.tgz","fileCount":40,"integrity":"sha512-+n4SBkeMkhUtsV+rmjmF2OsCqac9nKnXkPwKErnIZTbxIAqjEpZ4vh3sLeR7B7k9NmXplmEG7BFXvkfDvsyjKg==","signatures":[{"sig":"MEYCIQCmv4X0ItZlBiQ3x52WYSTRtuGoZDKJCEIZMTDzzx2gGQIhAKzKA2t2qLP7UOGa4CXbb1cpkpoPv87iGkCimXnfHBP1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdEUSCRA9TVsSAnZWagAAnfsP/A1THeGOt25EFPHj/Mdc\nYK4838nOImFTYAGUrsviyccvXpYsl+n+D06+Y8KQWbxmNzqC3AC2G2edCeBq\naMaUVQ9bXpyLJE0OkrhvOsQz09eAFWTNwqYR6HSSmmRCqfjBbSK7y2S13ZQ4\nM+wuCWVEXZA/Ol4mZ3FXE627njEAurSBauCIfiamMocY7YTaob5V3MvW2VI3\nvxo/8QJdR5s/E6dAiFnkq85SMl+CtnhxbCIlDUb+4vca+1J9oG4bjOVP0BDe\n07VAJiAJl8JjJOYmppMm19Os5MBTnvZC4XWoR8vUNflUpahqfSAkJjKcOhls\nMLyGNJNUInsXqD7xFiyxDp+aiDu95laOPUVFv5iAyr7eXWDGtwcJwOUd2mgU\ntrYOAznidQWAqSUnQN7ILZuKNg0azJEm9T3bkbCvaT4ZzKT9nJ3gbQbPk9BO\n9/4MULZ2M8Ucf/wCi3FPlJmd5O4jvNj1IufC8ZId1LhSFqIIsbMNy8bd5jN5\n4aMWh8hT6vCln6CwD446mfJGL5PXEGWyW2ads3gK3rJMwTtYXhyyT2ROcqNH\nYdl7W3AJZ/0gJlaFnN8NCADzboyw9TYU6RxEiODAxgazZMwds+ATjfpnIptv\nYW2Ydp9yJIWVnudnR+6j2aaFj3RPzfKTA/V54WCdqbKYG4DHd10QpxB3JhPz\nHYtp\r\n=fvo/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"89b2928224f69d0cc534f02f3a9d2d8ffb5d9245","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2330"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.1-pre.2330_1618232594005_0.20055476739611722","host":"s3://npm-registry-packages"}},"0.13.1-pre.2336":{"name":"piral-pwa","version":"0.13.1-pre.2336","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.1-pre.2336","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"40344265bec7c9aba656bc0549814f98b0969425","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.1-pre.2336.tgz","fileCount":40,"integrity":"sha512-gxrt5lsrupVUvdJA1LGWN1bHyVKucTYMnNBZaI4RtdSCdCz37LXgbIoVE7l0h3rMkeJa2NkLQBGNHHpB32mmyA==","signatures":[{"sig":"MEUCIESAC3NHOG0FxQmakiiySJWzGW+VFczC2a8wu1ZLMbUGAiEA1KpcTuYHHRq0Y0Gwxgu31n7FDhrr4YMvawBWDnLndsc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdbYmCRA9TVsSAnZWagAAyzkP/jggb/1IH+a2/kcOGv9d\nOkKiHzk5fg8AhqzYu8K3w6dk8QaMXTDrrI8yMIkOHjAcMIEQDmJ6D+Kx9UnW\n6EQe5+76WY3/I0pckmW72ADstpMgS2e3mrrSdXFI8qsQCpKBfXT8ClN7qAwO\nidT1e0AOUBaIIlkXK7xucuEnXgiLRQlGhM1SDkCZKMuFSBsy9inA6MnAJ11Y\nZZww3mPFN5jyXzDVYskluL5mCv1XW2eaQ95TsMmGpRduXnWV1NIAyYJ4Mwoq\nkU7tdX3ry/klVQjMvCsBN/bDcMEjDxzVYunDK7qZtMzusMXiXBvYPUdEc3Vn\noWeQkCIlpwKlNqYZ/Kizg4jX8cihJoOpAETYqfQV1fYSbiVipn7DPg0S7yiD\nNM9AmaR9NohdOdMobC+z9rFdap2eDJ4hLW055V82+JoKKxYy2M2T0JzZ0Rut\nK4zBzgpCdQ4GYvN3HR9997K2FJmnz/OjCoffBI+8iLw0/kci7sTZFh/IT35+\n+CoGCKMoLLMUxg+njJyKu+W76ja61htUgpqbohVMixnwW/QWqqIZTa8qT/dX\n/PUTHCggVHaG+uVJxldNed8GsSwDAkL0naniwwY28B6bgO619C0MEJIEtKsM\nakcPSk3doAKYem2XET9DkDX2QDalniehj08QSM/E00TxCCYNTd2KfCjgJHHR\nPAoh\r\n=qGOe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"fedc0f2d9c1cbcb9fb70cb4e356b639fd4983ec1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.1-pre.2336"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.1-pre.2336_1618327077658_0.6844172017321641","host":"s3://npm-registry-packages"}},"0.13.1":{"name":"piral-pwa","version":"0.13.1","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4a5f22232926d512f42aa04f0eae4622b264f90d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.1.tgz","fileCount":40,"integrity":"sha512-/Fp+7zK9QFrZIx4OgKcOCUAeFb0WGOJYcH6JzY3zMj0tfsf8VMIYfVIdntr+Q10YkdBr2YHEiX5PUzGcFQjcRA==","signatures":[{"sig":"MEYCIQDNe0sJEXl8cBA9OlguUNsIXmGWa9bu8EoF+aY1pPB01wIhAKGmizA56dt03p0HlzCcA1IGXaUY2wW455qvF5MS5h7o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdcZACRA9TVsSAnZWagAAcHQP/icBA2QlAFZLseu09vFF\nzPNe5cpLfIGZMaFDjfXeSqKCblsKp7Y5oJsTuAQDggWcVng4vImT9ZyoGgGX\nCzCgvBTJL1Ycv3vTGQPmJ9T09wKGQCDdch89XcpOEB/ohmCxt5V88ARroMb1\nrITzGVgEysTzm09UKOfATXXW7/LwOY+n/vvhT76o2bpoTMFgD64KeL+hqiqL\n5v/TQZiBtmnThOFCtcV5rJ76ImLooeSrbJbhpEi6NZKJQxkW55piKB8h+u9V\niX64YUxAU2pmTGQrIjIZ5FCY3eVW07roLG0MHxVyl2ITnRa4nUtwb9cjSvkk\nUqn/ZTsr/iFYehZxkorehz1RQwtxX9fYqEbN52pYVxKdNhquo2wyYUwjyLpE\nx9WkBEosLnUFvA27PKI3GfvNXcrxXY6LYTTBOgWfS2NoZ2ux67TJ20vrSetG\n+Oynyv0b0DJzSon5Oxfc9cr/4YBEeTPbsb6CC3eZwpVBd1pdVkdco5jNFzm6\nj2a9Ap6raqrHMjIJuaaEjxkh3uolr1bN3l3KNaiZ64lhdB9tjTyrEE8uZOkj\nIgs6xzPoFX2PGGG/WII/s2hYmcnn8PfNmZX5GXQqvyeYuomqOwSygrR5bagl\nvU4r77rlBdhjxkxGwAV63edt3tiBZVkCEVx75qFEe1lkJh6sj5YXl63b4SOu\n88AE\r\n=dP4v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"15662b1ed58b606a41f5fd59699720acc347ce7e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.1"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.1_1618331200195_0.9416264626238464","host":"s3://npm-registry-packages"}},"0.13.2-pre.2341":{"name":"piral-pwa","version":"0.13.2-pre.2341","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.2-pre.2341","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d927f173aee0c45a8c44731e8cc8a6b91e395d16","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.2-pre.2341.tgz","fileCount":40,"integrity":"sha512-gD8I5QHew9Sp3LuZZAAjRW9IunnUkyD2G4CxapADvzJWqesrVmOJfp8ks/IoNkOPz0Eb/JByuNhdPJ5kMswKbw==","signatures":[{"sig":"MEQCIHDZi4fg4KqVrLHYxux3lLf7RKQyLoff3juaivyJGls8AiB+ZLNwFPZPT5nkhAt7Lcdtggdf/grHVjeyl7rEtMkf6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdh5kCRA9TVsSAnZWagAALPcQAIQNmVpMMgfzskyiux5U\nV+n8a5aGx01LA5KL7PPnm9wSYxqrxlZ9Nj1USD6lpnQKFAaYDb+T7U1VdbJp\nGfNiyI2+8nOjOA7tlyjuEiE2xQwr5AHUimLXo2DIA44rxxO1FEvvUyE2nA/V\nS91KC7EgYnQUHbkyuOjLuqaWL7gdaNOgKHzce+oAmMlwm3qd47KhNKUsag/P\n9BF+glQPkhKc/7XLegNMsXB/OQbaclwYrBWfpu27dfzmSqoIZviOxdEEed9O\nyYhC6tZIzsCMq6Tz2OCa2e6WM8/Bkd7KBhRRCuvR57hI/IT2XNtIChV6/wCv\naNWK0EHNaHM1O2WKQieKQS2qD/PDFIFmKgcM4GsqVNNBYaFdAbg/XD9WYZTA\nbM0CxhmWYqxlBmmZbLAjEOU2GGvBKz4cGQUriC1C7LYlv+EFTLUvda9vjy6I\nNlVxdUeS/MHRDVeif8NeZcXURZAU1HSl3KdXjJDr2QvPJiDE8ldNSmrwbrA6\n15fqce5uasINdMayVVtPqEjD+JsSNTIbY9mF+APb3qTvINz8EGBG0XZTnCNU\nj/GwHDlpdsGepZaok483Q/n5hOllcbf3k6V0wXdQRCfHueLsVZs+uABE9VNa\nWDnCDQd/c447EOTD4BvGmeQ80AOTtpuXCc9JzuNYg1VAYAcJnwy1ghK/4DZR\nXC3V\r\n=BKOk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e049aa0620536d97bb88536f3e3bac233d03ae40","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2341"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.2-pre.2341_1618353764133_0.41871548209845044","host":"s3://npm-registry-packages"}},"0.13.2-pre.2352":{"name":"piral-pwa","version":"0.13.2-pre.2352","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.2-pre.2352","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0aa0bd4d798051f341c22d771432aff6619b4db7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.2-pre.2352.tgz","fileCount":40,"integrity":"sha512-/kQalNsIwsHzh9t1iwiX47ECa8SfBHUu+9vnXoTUXytGLE7orUP9epWlVoJ4cJhedLKM5xOh6s5vUE5mLDVwjw==","signatures":[{"sig":"MEYCIQCz2YuiS71jcXxVeEmZSEZ6SlltqDmxiMNjVITM++EUdwIhAPdAtOSn1w5TRo6eq2LlM4XRJ5jTVMT/hX/nh1i7dcpI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeF4oCRA9TVsSAnZWagAA3wQP/1PM6A2Vzy+CfqLpBKPI\n5CQj9o5YiVwgXKhY1F9dLubLeZdFsLAWbB6oF0BlB8Ecdab4Bz7z2PrWc9I2\nfGTnFXnSOYedfSTwdfpxTRueGvkWill9bc8XoFLwyOdegBTMQHZZEsCHTFj2\ndZTRvHEi6zN+NLrG7vp05tjkLSKhiP/vOnP0vzjDxrbo2e9oL9zSEgBKQuqE\nZ3P0fGDwHm/0LIvMH++NgOxgLjnNPIbY5Sh4+5m+R9IC+kDx7Kj2VUKVquWM\nlhskEi9obwuE3WzhinCmoe99OWIqMT/VHi9nVwgUtkc0nVor78PJ7SJgtnw6\nq8Zk17zMmY1KMI/69ZXu7pnS9o0kbtj5csTRGOuN8XAiX98OQeE2K2PweAXs\nfOm0IG1O9TxamwSS7jWPWYXWidLLhruZZSh4E3VX922pXNkRoSHykTAbGevr\nZU33w4xtmLfhv2w4Ewlu3/SGZQjLQJmc6g5ZI1BvD+hjulfalDe+tiT9sCUh\n+96hyD8ckALjhCDIOToffBzBrTJ4lLmJtgEWHj93hPl7LaVGMff0OBZ1hhjF\nrWH0mLrnvPlHrdBIv5dVg1R2PZqupdspasJQ80UfYOrvIIUyOEi9yrEEkQdb\nc2oZBwRDQk97c/CJAUZg94rGU+ekqKp4pDmh51U32sY2Ikpxh/AGEIwAVj2r\na53D\r\n=vQRU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a24affb07e9d190d9a876258e451908b7763d4c0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2352"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.2-pre.2352_1618501160294_0.9771590080272916","host":"s3://npm-registry-packages"}},"0.13.2-pre.2364":{"name":"piral-pwa","version":"0.13.2-pre.2364","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.2-pre.2364","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d77f88f185cbefa0d33d40c9a998215e11beaaff","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.2-pre.2364.tgz","fileCount":40,"integrity":"sha512-YvWXuMVLtaCPSpwdVv4xUr3KUGpr5PV9GJxBOzTAoHB/l2S+bwhdDpcVOj85aYqOx8hFWWneH25VgkfWmqZIkQ==","signatures":[{"sig":"MEQCIEKja0SIqFVAv83j1nYWegGlPS3M2OqkpX0JaSGleoAMAiBze6kMEmYvsl6RG/KCY1kaUD9g3P9gxFe+bUYGwFDcgg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgefLJCRA9TVsSAnZWagAAxkYP/jQCFpnfhJF1Xfo1eaUL\nrLA6v3TE3xu8ztMYq35X0FgstDBFH2l3Ot9lKDCHpMEwfqTkKBQrw9Rs6xzr\nUl4mXXHa79vcn75230Njfmmqh7UbpMe+sDw/oXLWJRC7Y8T3qVunITeA/TTQ\nI7pYt7wf9Azv9RnIktLQF6ZEKfHCUDatXDqnIYNLEmv9bVnVWfPqEuhLt968\n0N7Oym73eHc9YHI+PRwU7BK/eMvuwQHHsjTljPelQc1C5BERUOJb2ywzGzC7\nfQWOTRurz2Nbrx2Zyh4Xgb+qxx3CfqLYOnPHRajWLvRl6CUL8PklIX8YbdYd\nQ3Hh7BaM0jvD4969z272pUqTAHV3UshmMcy84NVBXblFEzI6afBPvYA2eBm5\nImNxtKg5nkoJU0XMMurbC7wz5ezYAhb3rxNS8xuqC19VK88gNdfDl8JyCQyZ\ncVACLA08Rpi+jIVthn+VNnuvM2d+z0F2nLQw/UgXs4RW+7dojTiOe+Wmj7Ja\nm4fBsMeCrRazYyF5b5fI7d9fvk1AAroJn3Oui8BaMKuwgZThXWfDszdAIvLv\nCwsRGUs1X4VorFIyK5yXnm3ouGmxrWIgAWke5/a6K1SNvECrVQV5JB8WTQgR\n05oJg6benMMnt9ZAuLxFuDft7jgPSXCxZJiq3yf4W4wE0JnhhmxkhTX8OpQs\naZHq\r\n=OFst\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"77ba433aec0e8ced646267d90ffa2bf7a64c4041","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2364"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.2-pre.2364_1618604744914_0.6423953064352808","host":"s3://npm-registry-packages"}},"0.13.2-pre.2383":{"name":"piral-pwa","version":"0.13.2-pre.2383","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.2-pre.2383","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4625ef75de8542b099dc11cf4bf6ea6dc3ff6b4e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.2-pre.2383.tgz","fileCount":40,"integrity":"sha512-5RcYqRoRVSc3mWetRqoWuZ1qCWWycocmPdagQOmwh7Inev5TL4/tpgnIAjeOkaH2pljAcXQv4j9SeQvCJdYoaQ==","signatures":[{"sig":"MEQCICosBr7HrgWXUozKcTQRhbPNyQXEUkHgQAjUEQKOHxl1AiA0Dcdf9KThx/gsKmay5+VFvbHE0g1jY7iBaP9FK1/DgA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgftVVCRA9TVsSAnZWagAABh4P/0wPd9/iIqs/YKFWnI79\n9fabZVCzTnvWhg1GHgLbibHDdo2MBLftusjR5vUTGmuG7G9zRHyag9l30yxp\nAZDei2o1hyyRJpYjs2bxBLm/6Vb/hAPBoPR/muqOEg1Z8HHOJEQIRthDaujC\nHf6FRnMvsB/GH/P6S3KcPsLp9h8pLX9ip5LpYDNfdtUVcpN0dDiAxw4rzyU4\niKCfhWp8Wu4kF7DxAabyi357hEf+aHuDs/DSQ+2N1QpphRBWW2k3YHh1MwGm\naTtn0blSvhxUFK1lyz4yfJDkkze3+SEtaxznW8wVjBH1LTIr8+92TdXeqyud\n7vqc3xt29neYdqfRMIS62cGIhtKvDojhmeH3YLVyB08ig86qJKWeuTKvHIZl\nwzKJSbAWezn0c1YVZkm3gtNW6tknRMUWYw5WezNDhJHJMxLLna41JVa6rvZ+\nJoZ3DEmjf8z6VnjqCefN77g0fX6CvqSckRN/dKgm+heifzTc0p09/CtiSu0g\nAneLrTDdvOS9uMKjRzul2GJ7Skzi0Sw4++E2KI4pqDNYA/6O5XLEfkpeOb54\nXdMVonz4jphW6Li8/wupVtvIqZa3qL8bghisaA+SmKpWRltY3bacwcuETgMV\ngL6BUrUgqxQyn00hu12ENUZpaLVUKuQOy2KPB8tKiTAK4fiVibikPpvgCPWg\nkj+r\r\n=iVap\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0867b27ba96060520f946a4ac0155e569b64c151","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2383"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.2-pre.2383_1618924884514_0.4507374846463097","host":"s3://npm-registry-packages"}},"0.13.2-pre.2387":{"name":"piral-pwa","version":"0.13.2-pre.2387","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.2-pre.2387","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8ab41a65144391077edb82b2cd25616ecca0b3bd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.2-pre.2387.tgz","fileCount":40,"integrity":"sha512-teju8puY/CQO0xZ04/UMB67jelQzyd1macM931oIGwZq2vsCEb6+c7w67YaB+cNCS1PeXE9qH5Q2XQBYEDaLTw==","signatures":[{"sig":"MEUCIEMlLc7B5IRAjVFIsjvRKa2hnlH9+FwodWKLUxE3tSCUAiEA0JImTJLyBQxCbSaEdTvXhNifqKc0L9A7X++yQ3MQjaw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggf8gCRA9TVsSAnZWagAAmHcP/RKhvVilbmvAkDR1fL2T\nce0YmhJmfqyY89MxdIhUSHmqZQmzELytjSvlp/A5kDeVkF3GOdY4zw/vWfvt\nwviD7ZaoL8vJrcXMVfLBRx/MlYcqkv6qKTIPzIOzzIEUAP2As4JIkLw01vgG\nzmmNi4R8uwAXqvyggcsByXSq9QME0vo1ClA37hC9JX9CdLk5ZUEPEniYEuzd\n3/XCCpl/WDmYJQndB0INGXj0g/NUGEDExj8UCqS711KgR5L/Zqtl4fMHVFsL\n4BOfIFZItyhordIYL0x3sun9KWwAxosXZ59ZiESp/kkV/TkngdU3OGVKTpTe\ndeK+Tqkwj5wtX/fY2oIALfPMbgo1ari220fUo7HT/C72xOa4KWe9SYSdbT9a\n3ds6U14dKWZt47nH/QULlQDX9beVLqn6qmJG8kwurpTw6sqb5elJzK1yelIF\nFYJSn3E3zG5vowbwFkFG2ZkvEPz41Is6cbMWGLy+IOmUN6dDmYf826qmrvOE\noy+TfFw1iylNhpZZmzgEiO8FbfztX7hK7RokRxvlDGXcXgcM3fERU1J/0jZM\nvV/OtqtS2LnJn9vDL5hcysXF2DJVkKyQ/XB0dKCM3uPLGgBeECHuN4rAk8gU\nVhQPwxtvtKmFrU0ItBAd8xRGvJnn4uOcAhOLJ2Ce9toOiE5fYHrU3UltDCr9\nfdaB\r\n=mqIZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4647051168368325b28f995586bf49659b86efa3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.2-pre.2387"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.2-pre.2387_1619132192094_0.24936425794453188","host":"s3://npm-registry-packages"}},"0.13.2":{"name":"piral-pwa","version":"0.13.2","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"46b078548c5c3b5c995cd2a35c37b5f4334653e8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.2.tgz","fileCount":40,"integrity":"sha512-tQA5IwbaHVvq5w5sl9PBP66Dc45qB6rjDU5Bj4QqtnGdetYa+0GPLsUWAK7j1u7a1sgAAJzSpzmXGDVJ6e2pqA==","signatures":[{"sig":"MEYCIQDBabmBHF5BKac4TKXP/4TJ9bph09+20NSIWkRsdhxT+wIhALhKZo87HqPHVDc6N+r7Zb7ZN0gIW5DozGZRx5rgSpXW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiDlMCRA9TVsSAnZWagAAuVMP/0huKkmYcCIorMmJnDWZ\noblAXm5I0wNqgrr8e4cD3DEBsa9cKdG0SzvW8S3dJlPI0fLEmu1XQPLX6BLn\n5uws7FF02vge6od3GOiH2hiU6GVBNu1cj0d7v1/2n7Y66QYdohZjeeeebTk6\nhmo7PYimhMuO1Pmiupw2y9zbUvuhAFNbaVur8xO3SMuQK1phKQh5uVXwgnFL\nkBQ0ZLnYb+NjgjyLnIa5s2MLYpjyhqoAm8efG9/IXBPivL69fA+duw6P11A/\nkjnWdomAtgYNKZ+UowBgzeE9SIwCrJ5gn86Eq0x0MQgoDSbUchgOpkynUI7B\nBLS0rKbHkmUf4YPGAuEkNgxdm5c2IGaHcfdWeW2ZaWf/Fx35rJImrUwL8DHQ\nnC8iw1jSj7MpN4eGuFAfUOo5EcuOxHFktTISYew9a1sG+NZb6MG3Xlo2hNPd\ncsAgXGJ0D9mlNKJB2kkBNSEKK04XK0IPxp7czKaCS1F/0c90OWVxeviNjwrz\n0feGdiPHwJQNpVY3Y+hwDe5uYI9uRmi5WamXIWg4M42BH7U4xH0ehBIgMB+U\nnBLpTM7QJ2lQTha6dv3me2M91OQj35xRdUnL0Mg+NxhJjHilGt68Je6oBStX\n6XNyagqSHFLv9nt7/73UE6KoOF4+rPSZrOTFCBX1UJY6BTfBrUTSu6u2Inek\nDgVE\r\n=r+Uk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"4326e3f73451063ee3b531c4372a59c72e73b1bb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.2"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.2_1619540299571_0.5330378631728756","host":"s3://npm-registry-packages"}},"0.13.3-pre.2417":{"name":"piral-pwa","version":"0.13.3-pre.2417","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2417","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bed76dd9e6bb080ca39d8988b987f6051dbaccc0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2417.tgz","fileCount":40,"integrity":"sha512-LvW7BXYDJTBfz2xl/6Ca9uqCU9/MUllqhed4aTdApugOeg1BPQftsF7qrb7+IpyW2rdc/5ABazRlpLc7TSUAYw==","signatures":[{"sig":"MEUCIQDUwnQAZ97NkNZewKWSuOP740CUyYZ0mOaCvUc4WySkGgIgKUnQslpdV9jFQA0DWtZFATcYkfB3jAECgHExMKM8oLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkRWICRA9TVsSAnZWagAAYKAQAIIcvS1HqF9a08qSRAJ+\nfunGymexb1XDh/VtzKuoCWwnJWqv3807VYESoY7a4T2VWuf73k2DxpuyZxSt\nrCN4EkvkI/Fxj5mEecxl8ZxPs1dIJMo/N/xRIfVjHdt95eh5zmdJ00ibOIxY\n9F8H+n9mZRlyKVYEX30RWJIOfDV+jwhzVuqeQRh2lo4sltVdo1CYpJA4s4V7\nq/6SBD6QUZ26vMKrL3KDqYlGXZ7ixI0kH0fMx9fsaqKEFXHo/M2yyRMl2rC9\nbErChCU9xPRr/pKC5VtIdKmte24KaNFPF2p+TqBDEawW2RcIathrDf51MTNP\nTH3qqbsSJzJ5Mpd8xDTBVKT2rCGqN6Lh3zV5u7D6IvIF/Ji7YdHQsb7E7Sam\n0e/jgz3DI5D5hZJAqzkaaJJyiT5qJdclb4C7YBZqpNMBzUHi1Pg+TW0FekD7\n8eMVIZgcIXcqu4jvONbZtrX4+SSC+THMBwXfE4lww4JrK+Q8t8ThtqkhQ67c\nJi6IpDBt7Ux8owC0glADku1bf4m7BoMvUbrgqS21LtGMCuDeTWGGYySEY3kD\nGCsocklCYK5b1eJScUZhMczGS2ZlesoqQeGcEDrGfVqgiRxkTWfe66Dgjk1M\nwTyCcHz41tdatzSz+kSAJA7Z/8azJ0DGDreQAzK28Ra4MI1YvQ4lZ71AD7pZ\nOwMC\r\n=rxyi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"17fb2d8b6b9ce724a71636cc1521af928a3ba279","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2417"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2417_1620120968438_0.3413042819297838","host":"s3://npm-registry-packages"}},"0.13.3-pre.2419":{"name":"piral-pwa","version":"0.13.3-pre.2419","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2419","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a96adcd2b68466439f82d91769339780ff700d9e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2419.tgz","fileCount":40,"integrity":"sha512-PAlgbfBbTmHXVhiQshrbR/4HmcyKkO4hhlzR1NB8wmSFS87gOYFzm5/6ry9N5WstCCPG2PK2OJAwBE7DZPnL9A==","signatures":[{"sig":"MEQCIGFvMSgpG6FIt8VFr08cpBsXP/SVYFKammJhQFzvch26AiByUNGkD53/4kmCXmSxMCIPf01YivzBy59OHhmynyNyig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkSniCRA9TVsSAnZWagAAc1wQAKE54XjWt3inD2D9A+LK\nuJ5h90Bp+8BY6KbzGJAKStoEh/mVoxeSs64XpdWy6bQOs3KcbWCfQbzB6oJO\ndwwVMrMrMQv1R9x47dZ/uj1+bt313wVuYwimHVCw3xy2iSB0X/82zyJRp806\nNowVLLyszPczQKO+TFu0rEpPSJRIGq++ov3o79tXYkyAIz/jyVV53teJ+VFZ\nQF56Oc3LSHzIGQFI7axJaf+t9wRB0MjF9+fuCp08wBByUBTgqjvTDhTiPokx\nOMxIcNeG4IA2sILXmnybCdR82AXJrYQfi+KyJ5oteKhSQQQnkeln5vOiQh1r\n0VxDzMzJT/tHBEONsCaJW0V6lhQxxF98e5mQSHWfRnGgqyU7Iu5Eeisheykb\n7eXiSnsg5N2m/MHd+CjyNXxdyx2uwy+s4Ja4xtXPNPbu1WUuKbPGhbvxAevB\n+delyZoZDm2tixqFSESpb9Ps6peHq5oAGuDdJEGs7P0cx3E0lBfT2/EsfZ4F\ngDIQyApam9ZssXEM4NT+2sSq9nMZ5ljzSWc9HT2Pv9FzYAnGOLdS/StOdnQn\n4k6Nh39TdFYLBHABe1eM4WZhVywN5N1ehrJawGd70qFSFEvmehWwWi6XhpOA\nPQxCntdoMIrmFouSiw117n5e8UYp2KJ25+GoHl9MTtXIWot2Oa/Y1gTrCsX6\naF/3\r\n=RCJm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8aac729bb51da8426a373d5e22f2e857860ba7bb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2419"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2419_1620126178091_0.3562178025620617","host":"s3://npm-registry-packages"}},"0.13.3-pre.2433":{"name":"piral-pwa","version":"0.13.3-pre.2433","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2433","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"480a00649b18880aee13108d2f1939b8ee095cf5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2433.tgz","fileCount":40,"integrity":"sha512-eZhPOb86ebFF8AhoHLpTYMV69ppSYs0wF4JQkvN73zfTDPs6rsb4ZmP9Lwpx4Q+Dr791e8D7q0N3lROEfWjk8g==","signatures":[{"sig":"MEUCIGGe/bybXE95Lmlgr+OLpSenBsKCUwn9BABt/7M3Z7BLAiEAjLTUz8xdo2Pbyj8rzXJJro8E0ciJPPZdSFEOyZuqdrk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkxHLCRA9TVsSAnZWagAARhEP/RqgtpqMZpHM5nHOdl7W\nlRanR4JUFWozhCol39B3Iegwx9olcLvbcSSd3wqxsyUdrshn8SKWF/ld/2GP\n+r196sOnGy57eYKY2dyDEr+AcOYIheeyBtfhVsY4YupmC172huNWfC5Kc+8e\nhmNZXf4HB3Z3SjyE6AoKYaV02uy0W05hqCDOw8AZG18iJiVgoOWEPC9nwWc6\nvGeyhNEu3W4BsEEsolE3Zca1uHmcIRieJrmPelxK7b/6l3Ct7mFPmL6RKNtl\nb8xyEgrHFBD55ioM43k/5wVJzwb9ZPIv3Vs84/e4HZq7EkAvOT97GI2hZvs9\njvAp2W75i3IybQ9SaGiPqhcd/V7Tpdf9ik40xhMCekBFW41o6UI4doX+h/Uk\nRTvdvJgUSoGTz6/p3qzaQUeerN/INyIHiVbtBqiRvUBt3cj/OzQ7kvldFknv\ngHEFB+dviTSUwUYUzmBFDQ3IzzkVgOVs+LneuwkxK5q9Fdgcjc00RMTQa1Gx\nJeziMXML1gniY2pCJlEr/IUVpQV8EwN18/sskxJKYaCTWxEvXiLF/FeEcg9E\nLuFrHY8EgoZcMQpTPzsXiJ/a/zmtiMRbUMUkUZEN050UAo+qvtBGZSDQQui2\naEouTIYNOUCZJAdBwe94JJlmgCsSw2t/N7PnX0Nn0zRCAjMdoFw0yO1q4Pvd\niHCF\r\n=Vu7Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9007f25b9a69f1752c700b6d57d0757631ecc2e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2433"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2433_1620251082590_0.021468982370304257","host":"s3://npm-registry-packages"}},"0.13.3-pre.2435":{"name":"piral-pwa","version":"0.13.3-pre.2435","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2435","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"89af4295ecdf5913c6c96929b419dba7c87cbae2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2435.tgz","fileCount":40,"integrity":"sha512-jPdA4+AcOFpiNKCl3bTbJVP460yKyQamyPmh5Cp3W5WsjtQgThtdlcL6VuB/1qsYQA1XhO9XZfUJTGiYBeArAA==","signatures":[{"sig":"MEUCIEXZGw7Omfo3Nz4E46LDqps8zGfPzbWCctuoPDHZxbTwAiEApNG/w1eXloNDxi8S9TJi7rvPnilLoRqUrRQeoSH4wC4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglFblCRA9TVsSAnZWagAAeaEP/jzcP5JGMMZiz/CGL1Br\nHQIlm/NtxFJkdRVPhGh9Tm/nSkLPNP+Ul2sYneABXEdy95nsEYad8Z7GaZw3\nLVdCxcLK9PwgooxfffJnQKXWrYqlSuN2AlswJ+gRFYrKLuT24mlGtD9wyDx+\nTaQ7Y8F7Nu4pq/Duy3EkhHZ30nMSdWjx6CcQGjgBFwftT3RjS1XOlENzCTF2\nJPIC8IjYmzbsEmSrDioRgwNtCNLqJg4ejKY9dSS6ki098+XrT46nlAI3Wole\nqrVVdltey28OsUt2/MdOzSPmc6uN97umCutRlb2RyLtn7kamyL1oljqPqSPZ\nkzkV03USd73sd718Fqqmh+ETuBnCajKkKcOS9TSfJeIA+K30Cn35blgPh4UD\np5s1XCsSE8rzuhCtJvwIKGsPGXBb2lizdiV/TZ5Q1EQmJx2Z+DKKY2fh0Plq\nhqZpDAhf9N77KVRRDxzoPtiauUo+JU8H88zixXiPyQKND4liDMAUcxyfb4tv\ngDdLoYJFlwHN4rKHJgGPRCJR/fcHZuoPFAQQI4rxWsjGJBKqMw6DO9JsfkoA\nqweBfHlxyjXZ+vQc5UkrQe8Wwa5OAx6qBY3bsF4WoJIMqJajNFs/vRsR80Ex\nNbcNm493/Y0+XjorHN1J00SQD0fc10/c7Xm3OG4NQoSV3aRxuhDRr5/ntA+3\nT3oD\r\n=ee1A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ee01fc6061cc9c99b2c4a8814a98a2e8151902df","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2435"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2435_1620334309424_0.0232295409328509","host":"s3://npm-registry-packages"}},"0.13.3-pre.2437":{"name":"piral-pwa","version":"0.13.3-pre.2437","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2437","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2d94e62d9b1927871b7d7a54f7e60b2c860e10df","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2437.tgz","fileCount":40,"integrity":"sha512-NIcoJfiUl1ZpNdeEaJS427hSVbTcXRY85KrA0SPNq5RGx7KQziyspXbSy8xWzFMOijzZChIrnW7QeAjdm1RfdQ==","signatures":[{"sig":"MEUCIHH5rSiJPxQpTLBYMLV5crLpiUkphShUJ553TVhZm6aBAiEA5QvGzYwb32va33wAGpY0OPouqtyQrOClS5Vb2/kPJso=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglzS4CRA9TVsSAnZWagAAzZkP/iswgCClHNPTzOz3ntel\njDWIWhDKnB8U9J3EQZwo5IGWlhHzCWWay7w0KSC9eZMKn5lfKP6fM3gNtJoL\nGKQwl62oGXXdTHgPFmcyD8hh2LDrNtka7VJgY+OCzZmirnZPN5Lp6WQk04Lu\n7Jh52TT0duIhPl8FFuYubYxtIxLEnSTn1kLHlp/soahuzg+KkttsHIYiUE7s\nkOU6q26uHmgl9L4rMQTGYFlGOM+Je+ZsGPsopVclSerdxJGUfbqhIi5rrETc\n79e5+kCt323eKt7YCJ5EChzMAV+/3WgZFt2/28mIy4ufpX6LOtlE7rXGkEYg\neQkIAAMD9yO12QO2rdfIwZGQQe5Fg/zBEWwcxZdYOLbiqo+tx2l8yziuw38z\nL0+wZIi4KoZJDl/g6WuvlDtujesdCzEG6CHEocS80558V4PaaI/716PWSvl4\nYcGFYoajA5P8Ylx6kX/ZAzH3VqeEe8Pf+z4H01VYeIL3bkUgb4Z/56xE16nm\nIx8mTgCciyiXhJB/pvSD8/8oeKPxgl1+nn+MP8mD638TXGA1fAWWV/tz7NrP\njpsac9ZKWCNwEerL0pOBjQo/NM3W+1nbTwVO0LNWMPZwDlq+tLNgMECUOiK2\nPXcJBuHOwFM8aw26PF9HD0W4rgM1UrCbLPdLdQp0lFc/66NvukhYUTzJSj8F\nOgda\r\n=qz2C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c66114d2d94ef4b00c2aa7c79c43444efdd9b953","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2437"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2437_1620522168411_0.6711200835831903","host":"s3://npm-registry-packages"}},"0.13.3-pre.2442":{"name":"piral-pwa","version":"0.13.3-pre.2442","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2442","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"20a780f30cc1f6101ded0e23182f1c2539219e3c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2442.tgz","fileCount":40,"integrity":"sha512-rKeDow9CZxVSrLkAAuJJpBlSYejU7vE5vBZGz/O+5Wm8GWsi3ETqVqvxGUD1GaA2u+2p/Yq9Ogq4l9y3yCc/HA==","signatures":[{"sig":"MEQCIDvA6gHaq6VgEnTjvgAYPFeeh55000vsvaAM5jT6x1f7AiAqXmJnY2dZR8RLh56dvC8XPFiY8CDiximILDsaejmM0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmEbHCRA9TVsSAnZWagAAteYP/jZaknK/cnC9HcQIDX7I\nQQOZ1KMU7zRbxzcVMAL3Vb+P25gqAyX83mpD+xU/9rRbK0vDft8TG+WaovQn\ng4+sxolbju+01wZN0lLQmInOw8FbnNomhsBAlf7qU2BNWjIFzVGivxZSdoej\nWNb+TZqV7oXCnaYDPk5+aASYXa8xWARdWyuYNi5FE9fsdEiNE6kqDAQmUtaD\nwbK0EBMyxjcSxkRxv7RB0gyogz5ERMod5QbmVHivGjLYEPR6+qo9e1hEBrsR\n4MtjMtIf+pX/SbpZnMGVPgHnkxCB5BL+nkVO5NPbO7lVtWRgOp5bdg9FqyPO\n927cPK69F6BdFROgLBulZEGH5AIV0QbblSTuQfFKEDL2O7WiJYvQZVfEGuox\nTIeH1CqQvogvZCdGXWFj9ftJ8Hu88Zedgl7VmwCc5JD7g/EJyrqietLrza5w\nqZERnM2trMuqfeQi61xRYpoijn8Cs7+6FKC34uGvwUtQL4FA9O50fpCiGqdP\nIcRDQ1p9i7xkOK5hdW8yFKXQ4A2cMOtWLO39DcNrHiRPcojc3YxVTex6HOfU\n9PmzbQp70nnYxSwG3LMQd8LcWby0OAYhABysANY9nEvskZ9LUHyLnjKAKqLk\nNDFSn7Hb8a2gYCR8zqDXug8xLe7O2yySzRj4/40Yc8GIcR+D2SadT7lKu7vg\nQCfB\r\n=jUZZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"aefa42440135d97abd710055953dd7f1f1f97cb1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2442"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2442_1620592326682_0.700498071252601","host":"s3://npm-registry-packages"}},"0.13.3-pre.2460":{"name":"piral-pwa","version":"0.13.3-pre.2460","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2460","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d15352eee59e824def5e07b2081633f5c8311ec5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2460.tgz","fileCount":40,"integrity":"sha512-vPucEiBKrmsIOa+r5vRxF2RiJcTXwWFB8iomVJTBobnnDv6f1NCjMtIpP8hwM/5KhxKIDEs0fDkAi02KrXr+2g==","signatures":[{"sig":"MEYCIQCxIBCBgJKXwTBjGKADdhCPgUH91czwGiKsxNbUUKEh1AIhAP8W5Su1dWWXPslJT7org19NddV2Vu1wePzGsK4+BlL7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpRRjCRA9TVsSAnZWagAAH1YP/2LyKU8bTReZwVUZVddI\nY2hIfFAGzbxtBgWNDdv5BsOvkt2MPY9K6HQalcrXCp0j8j0ZtHIFI2/A25xv\nUrQN1AGXgz7rJoYv5R2+GVo2OywZz8dxslQ14bYkKXBDenqUhJWuV/dv7FIj\nTQs8LYdpZBDleIHn/ZL4DklzWdtlYbWrC2k0hYAiuioSV11nnsvvtRvodtMs\nU9+xK+olRv2j6Sf69Tm4nkYb9s5OepOS1QER5lzxQ/OX38OSgf4XQb1eO8TA\n9yRjCGo0or39cBoBbQ1rL0JJNESDsSjHn2Vcr6dpYd29emPdaruJbHL0CgIZ\nM9f8DMNUaqvriQnjbaVlncZE0QtsyUMMRi281KTUvHBTy2pGT4MtAnkaSdAL\nJ/MDSqpNnKJDtLFcGayfn5Zy5CD+B+wW+DGNeyASGSL+QKeDnQH5pWchWREI\n/hQZwd6yuXICSxcMS5NT10SvwASho4hZpbZTcUpXx1FNAcunrNvlbCMJv1lg\nHYxQ/ONGyIVxLRUI7Hz3cFyWAUtcfZGfrqP3HT3MO2WFX5pHVLQQfGciNSln\n6VzbIgkz25xngUYcW+6x2O9Qp2J+DS2F5KACDoGUDhV+fWyeQvGiy3bJCmxX\n0n8pR8xMHSW1yTKM19GjV3zEacdq+36vznw8FZjleu4hzmm/DN8iqs1EG2Lj\nB2BG\r\n=oNmm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"11094c1d3de1aa4a7b07f4a7df9148efe825ffa4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2460"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2460_1621431395564_0.7184425550267788","host":"s3://npm-registry-packages"}},"0.13.3-pre.2477":{"name":"piral-pwa","version":"0.13.3-pre.2477","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2477","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a3e5d86cfc4b180731110e47ddaf2e9b4ecef157","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2477.tgz","fileCount":40,"integrity":"sha512-42K1EbPywqmSuNsmtJ0gksvVaX+ZErWsBI+Y+h0d92b4Jbq7lJ+kwJvphCn8bzm5LTDMlbfI9h5B4J8rZJunpA==","signatures":[{"sig":"MEUCIQDygFiOQwbW1TLR2zOO6A6P+Q43JNaUXdvHXbWCwmDsbAIgCwAyxvM7G0Alvu+FG5q2FkTtrxVmTPOQJe5YEhmD8g0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrQ3cCRA9TVsSAnZWagAAUvoP/RY5vMW36zMIgqG9Otqs\nXtIXZuKXXay4vW1wYoKntxCLxgTgH6XtMaHqaHBHV+BhWM8GoTNgaiKnKr1B\nVmTMIJhFTQbGwLZfHdo0lZ9N//y+y/5l05aTDYHV7EqQKVuUmFcT3kaO95G5\nXEDZSujwo+Rrtee7aUq/TaTG5ZhKRLufDPFKIT13K5utX7PAYY7qzue0Nn3F\nz7z8UKVaYaiXDU7bchO3LQb/5E6WnmMU9wuS4jlA9g8Rnr2TfXHeMi58QrBE\n33wcj18GZpkvv32QPVv5laaKplD+dOgeJayuIxF8pkE33T2mc1ydvkzwx6Ap\nwFR6qLDmTUZbMJ7GatnMYKVn2+2OG0/m1+bybdd2XxKXHWu5tt67hrWqXu/3\nsG4Dow+jheiCzK7PpYUSFi0ZAp29dI/GvOx/Yp2X/k2RRR0hkTU5uA8FN50r\n9893DP57mEcbcT0XLJR6IdIh2JUaN+LDUgLq+Kxd+Bi5qppUBxUW4QT7o48H\nkuGNubmiPrQpgutYthx4l0O+yCZ3jRUYgO2HHf5oTcLzYPmg7qoNb0gZZCEn\nCCouvu1+msQZjdroYwojMfh+J5yU4SxQBibnEQ0h7HyZjcsbRTByYn67ho7b\nqlc0WeJGCwMk6dQ/tJawpKu2DTxOM3SuG+h7bXl3MIO+GyOoppCS52XzqV0R\nELXO\r\n=gD/K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ef4f9c312742856e05815d1eef00504e9071d1e2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2477"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2477_1621954011984_0.7248082016453274","host":"s3://npm-registry-packages"}},"0.13.3-pre.2480":{"name":"piral-pwa","version":"0.13.3-pre.2480","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2480","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"981c4fc281108bc4464dce1c2fcb1c3cc68c32a1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2480.tgz","fileCount":40,"integrity":"sha512-XrM3Hpe2YEfpt3gGFY6c1FN3iIj62nHXGtQP9XqKnl0HQ8EfJa2CLqGA3ceozyBDgr0CWKwWzyi99rDHitbDlg==","signatures":[{"sig":"MEQCIAl9Qyiw9GAqPw4JD5jrYW3n8d61Hezgk/gCHUJdmzI6AiBybzE4bvuP4NfPG5pELY60rRAFeHw0hOpjcVz2bhcl7Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsJxECRA9TVsSAnZWagAAZE0P/RA1doHV4fEH1neFa+R/\nEl1kq42eqU+KU5SduA62YU8c6mFIwQ7E0lbzdHaexYKGB30ZZWiAVSgXxmAa\nwnLZOkiwfirqjxftR6YC/ADM+4SU+46f70oqFTz5foIPAayoIMRzJUEDoMzi\nQruDIRoTZyAu4Opv+l7YJrV6rIWJgxv7+dXXUHpibtQ2df3FPOPKdlOSFkOc\nz1ZJxHI0gO/kcmhh/36mECtlDOHBW6jSOrxWqy+mkVRjV3WFZKeOdIqvbyEB\n/hrQQtC0w5nEGkWF1jc8vw3ZWXhT8lTa5LDGlko+AUPuF6jRBe0X+YUgoZKx\nquwitGODOmeh9w+0xc84h2+w+LalNGaXfpE+dQg3nmOQwGrUpQMcKiaEj3CQ\nVP1gDgdXuHoDZ2VxjXUGlJPxA5eqKW/kBcI1ckAIhtLhJq4ePc3iOBJ5Wrvd\nV6YTXdE98kH053x1jeJM5Kk0qCpCHYlOBCvJi4P4gIpXm/VpVLO3oMFv1/2m\nn19yuxBMcARo5kzLAQ9Q0vyr3+hc4Cbiee+omP8cU56GSZzRpspl5XKpzuyS\nPwOp5qr6XzQGrlNm3f/cBMSNi9PVURGOrQhl+KxSPNq2GWUO73mEsVJQ+HPB\nAQm6RrZu+nFSzThViGxJgI+Et79dQYpRkDPUOJaHURiK2amxDTJhhdP/AtKA\nYfDk\r\n=8Dc2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"28679daf515684133859cf6f7c54d4bca57cbb13","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2480"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2480_1622187075927_0.9109432394419901","host":"s3://npm-registry-packages"}},"0.13.3-pre.2585":{"name":"piral-pwa","version":"0.13.3-pre.2585","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2585","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"75ff79b258b92a417b6c1b2d0a465e810317ea05","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2585.tgz","fileCount":40,"integrity":"sha512-yDjPbOpNWnXZBO3uTM8/V5+y1pBt/gn9iu43irAUPXiFNFPfzfcZJPDISp0vT+lIG9ntJc4k0j80hthRQDf1kQ==","signatures":[{"sig":"MEYCIQCCof+OEKy0o3ZZSUEbKCty2vuCUnpQwThc5TY6NAg8kQIhAOydTsSLdWGw/hf73OoGSdNRAx811f8EtsDLq0aYR9L+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyMiGCRA9TVsSAnZWagAAh7AP/ii9K+U4C76n2/ecHz+c\nuRoXBiY6i3w2intOwSMIg/+BDLAFZrQ6UQNC2Dl//PXmXHrFdXpnD9cWUL5o\nGANeW6Gz/ahdZVzlg+txwyfwDxR7Kxk/V2+s7+bBUIV5NCJ0DFZxXABebeeL\nbGP44z3QU73+LX8dhwsP38QrNQ8jjRRak0FQNoRrJQSCumojUNdfs76UptFu\nb3n5mhgEbCQC4pG2ewTwlKsMMM+14rWaV3M3JbxtU2T5GxFzcuEkO6mw4503\n4naz1LXCytoxE4qFTPcqCXUkctvT0Ba3WV5hjUfD+imSYFAz2ZbDbnsmDe/A\nyVugwOrVdOX/ayfpaHOQ8a1jHP5zRv4qZeJGWadvrCA5dZqXMVNZ/YNmAd/G\ndGdK8cvdUp9tRAom188rqB78x/7wWknfVR/64vEbfkcq1a1F6zt+3V2ucFPv\nKYIfMtDi8D9kCzJLEHKWIQdqEE78Q3Qfn3gbVCKLE5ScxkeeHeWSTlfvUg0y\n2bt2FYhpbGqqBJ8xnZMWdbJvFmy+0grwG+70HxYldrQrxEWJRCAtCzxMf9Ss\nztXxfDY0XFYnAyyHnGj52qdsV6wwUj9TlNgHvmfdtBuxrDfUQj/YN+i5Dt1a\ndNPVGyInu3fR7p6kOVx5l0W3zjJwJYFkyyH7g2pEXNMH+ZUJHrcYUi4o0yjY\nWYF/\r\n=F6X7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/master/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e19514643b1fd5873705dcef55dbbc65642d2a03","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2585"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2585_1623771270387_0.9508812576428256","host":"s3://npm-registry-packages"}},"0.13.3-pre.2783":{"name":"piral-pwa","version":"0.13.3-pre.2783","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2783","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8b1f50232cc768e3bd5a929459f2a9b7799e1d65","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2783.tgz","fileCount":40,"integrity":"sha512-4RKqxDnblW9lb71ExNdeC+KmZ0WxS5MtYeDb/OedNr8g+S7n8bSzB3xKkJZmgzyw74Hi1RIEqlEBa/DJUK6Gug==","signatures":[{"sig":"MEYCIQDgsCL0NsqtI50f4gOB0u0I4bgJLFP8O3Bjj2irEH1lgwIhAL/Bvwr/c1/e91tfSlLVNZQ4GrhQtvbRaeWVPEUner0i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2JTTCRA9TVsSAnZWagAADYoP/0hRTXlIXMe3+gFq7+od\nJ17UfWMus8Ey9y5dZbb8mnqoSZbU07TxSCO7KjqbCsAF8E49NtMGQVN1shJA\nm0tJ78ayFCK+wFNH3Two/eoFaIQLbDE5WA3DHa/vvuC2g1UofuloZINlqGQ6\n+Dup6223EF49gUfKBuTHHKdXYDbA3dTO9iFdT/OKkhljZ+OzJow2gPi2g3VO\nLvFfoacdKwZ8LvK2tzJIopSC9u4oge3Kk34eTgp9XYOqTMUt27UGLWZyjnNv\nWGiA3Fuq4tWzs9NOHn0SV/njSDjpbW+W/ogkCbFY2LEE4PYequgAx5SGrt0l\nUTBjbmLJQvjjxrp2YfmINFzGAoRGz/47/o4mwSsyta4bpCfP38cLj9T9bvYY\nt1Mvk1DxEMOOtXB/CZx7PQCA0bicIRhdADth9wrXoYAReMsaXIau6aWKTUv1\nlGS+SStG1dfFg2SBQqm2cJ8MG1RSDago0Fn6xE+SDHWiA0nC0cZKt86XX0em\nncRxgVqxdeSJq0pVXptLgKXaCDQLcGXjik5pqStdVdJg/BO4LUdUh+b4uCEA\n1hnoZERLH78ZFlIWAWb16P6dfKhHAIKUxjaxaEYc3njoPt6tFNFoNk7DzFPi\nHmMV8copWdFFGZT/I1YLH47j6EOYRmGjvTbg6pvgz1jMeOU9HX0sIjhQDClJ\nVy3L\r\n=qUyG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d5d27630af09caa06ec633f00be17b8ac98bdbf5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2783"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2783_1624806610497_0.7526409496568165","host":"s3://npm-registry-packages"}},"0.13.3-pre.2928":{"name":"piral-pwa","version":"0.13.3-pre.2928","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2928","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"aa1afcbc75581a615e56e439e5f4dd9df295ca00","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2928.tgz","fileCount":40,"integrity":"sha512-iB5DYdDjVle28roIIhkZxnN0Jbt4dBraxXcWKZCTBtk7DHXFkFDQzxgo0l5aI5f4+d39AROJuHZYGF1bPWPwMg==","signatures":[{"sig":"MEQCIEeDsu9ASLxvRGVcGta5JYHYo1GwZYgz+GFM7kZtguMhAiAYEty9GvFvYne/Yib3i52Mne0fsMA92NcT8Q31E58eVg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9hLMCRA9TVsSAnZWagAAtYYP/R5JGh3G9z3smsomRkXU\np81gIn3xU2s688z3tcyG/rgLLh6HtzEZFMUouZ4j0GJO+gbnI4w/CnDgn4y6\nCfrjUYH2g9UcOH3W7X+kfRZ9lXgeAZDaH5H4F847jiyCBnW5RnpEG33cN1NU\nSzjRCvmbZJmHA4jRCWtF23l4z2w3ExJFEs9CcOtY8ed9x3VKAn88BH3yGYxT\n7OXWPkb0zkst6A9grTThJOl9vd6UOGXu3ug+L7RVSA5U5JmCK75Rr5q5ieBM\ni2hqK0G6XlfF0KIDGHJUVdpC3R7lB7Edhp7qolE7r2ltdQia/kjZKMFSSY24\n6C4412aO+yaGgm4dwXDyQlgSaM5CrXKMRVpHdBK0PBv1WW/8pl6epO9yselF\nLJvrpjKvqFU8RPSez1C+K8pR9k7/lGtMe4J2bDFEEMwQWEiZd1zVCwS/41+8\niQWj0IVAyrwhCEPn4bVBDy+xfTf2eglwl1qB6r30wkHGXm2u2on5FkNb/gTY\n+rN3YtEi382u7anB0hO3zCPgMGuOZa8Oi1fL3UyDIITKjNJH74pM+BExIbXn\nG2RMXvcg6gwiVc6SMG6cfjEk/f7l0gSaVVSjF21xT8QgNbSFmdnYftFnoJFk\nBe93YWyrUevAIshcCKg6VtpR+/4f9CjYSMPD3ZKfSVwB++S9cZX0yEESTXCp\nXEXn\r\n=pAhc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"6b0e2084d9abd9ff80e319aa1119adf4c3adbac0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2928"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2928_1626739404246_0.84967151635026","host":"s3://npm-registry-packages"}},"0.13.3-pre.2931":{"name":"piral-pwa","version":"0.13.3-pre.2931","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2931","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"818c76ed7cd85459c93fbf9f86cc7ac1e9e9243a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2931.tgz","fileCount":40,"integrity":"sha512-6PFDIJws3KTHaLvb/nepyi365W0USI5gfBJ59LFUmFu2DpytlUrMGHtuAiQxwMxQ331bRFXZLErwP46N+t28jQ==","signatures":[{"sig":"MEQCICiVFKmCgg4Q9yZ6TgskNgLrb5uADzqoGLe33EAf0uzBAiB6d/i5wXRI6+Bn6G/dtpgVe852kcpFU/RnPVIxJzjtGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9+i1CRA9TVsSAnZWagAA8SQQAKRjgX6c2L1tEmz6ellh\nJuvsIkbJvOFPjQXGEtUrUmSYQIUTxr8egicXFPneekg8NKKlG7DW0Oj8xx8N\nfpl+T3zAjLy2PDaiAENK5rvFH0NDUab7cIKJeNJ8o87BXMyqa8XJBN6JypKO\nsYcjSYaUW6xKV42lAv5fIyHxURFIn8lPQIN5M07OJ1ES6bpjWZqtiKpK2Vay\nBICn0RvYDUmRbYm8QIbme3KBRoZ/fBjJA8g6RvBmUrhkj4hApeUj69h4q1V7\nB/MnY/TQlo5DHGs31DgNKO3mGPsw9762wfuHXAOQ+0vhseD5FxRXNH8YWFdS\nflTFlxWlJQpMzMMS1g7AvuU0/ef2ugJcLh1tvQWdc7Vc9Hj38ID7vCx8p3Qh\nEwPxobzVssOpHn6wAvhuDuyLMccM3thcP14EfRF4TWv+BQzydY3CuYyKUt7V\nigBjKCoU2ptmGcFNw+yck33YEyyJCOF7NacgOXQ/ClGqZd5sqOsQIIQnnFzH\nBb6558ZI/q4WJKk3ocNc9II47nCx3B9SCw3iY3i7FooOo32K4TCq5D1Hl5aL\nkpNYxykdF2ZcUfPad+QNUxB6+WlSdwRgOKiZcpSW6dYUGt6vnju0on3ykM+M\nEWm2blnn3GjxZd+qNDscLXHy1BE1BpjhqUbzorT8heYI0buBFN2x58eGt8Jv\nFreK\r\n=Z5Ta\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2c33e1b5cef25c3e3a3c75434b41d78053f86976","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2931"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2931_1626859701706_0.6924229712862775","host":"s3://npm-registry-packages"}},"0.13.3-pre.2936":{"name":"piral-pwa","version":"0.13.3-pre.2936","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2936","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"59e37db645f58633694fc939f32401c7010899d0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2936.tgz","fileCount":40,"integrity":"sha512-LxtWPYqDwkilyiBJNPuE/UKq/AWt8Fa7XC5R7i0SXy+SHpesEFUzmcRkvtwFaWMQvRGVKSD5ttepW5XaMFxe/A==","signatures":[{"sig":"MEYCIQD4bbpmV3rJGZZdoxLsKLA4TuWhhU+EaLp5af2FpCjcKgIhAPafYGOJoUF2lPZxeGeW0wk0AAPWfzBrue3mBcMyYVBo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/sGiCRA9TVsSAnZWagAAzX8P/RXHR/SvT38C3mlqX6GJ\n98opke5oQ8FheYJSSBf9dAxtY9JVhljm3NwT5JQUGpOpIc2ssCpgC9KpNofh\nNdV1z1a6MSWfjzv2WMEkyiS0b9rOA1Jm1LNwpxivheJkut3uKz5y6DZPNsWr\nRzVodAls+PZxCzoMTm3+dz4MY8KFb21V/lxvPcZhB0xvdhslGNfY4aWSgHAp\n/gtp3aEAx9ytC1jN+ByMBJoQvvnABGTwK7w36f5shwvrHqEjCbfJCpn1CYPw\nBMrDLnfbSxdDftEQtHIb6wyjAQQsLSDh5HQzXW/mY8QCh2lzsI284nZ94ibb\nROd2ewNJ8c6kSMrdUT65ZpS3shmnAXDqPeYMTnfLalIq5wCGWTvWOmX+ZLRw\nfzai4HC7DoErAbNUOMuMFrjSOHKMImZK93Pcx5//D9GPy8XUIaBPKTnSemNA\n0B+GpVyl4QswkMu9zm6o3vDAyfB/Tv4kC+kKz5XRq+tWamr3nEusQBwWPbpo\nF8cb+WraFvG9HKlEpof268eR+8BCQ2hOo9qfN3wzYPAxn8sMdWP/l+kQpRyM\n0LDFaIZW3EoZzlYx+X2jpA0nS7LkGlkWNez5DNGBsf5kpox9QKMY1WwnGDfJ\nh0cxVbKZWGsZFIB/BjNbx6equtA+pKo4ugteXoBG2P81uoRkf9vnXn66CD1g\n5FkP\r\n=5PuN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bc49c375ba6b43e8e945707cdabc90f0b8d69ec9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2936"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2936_1627308450251_0.4153000326052647","host":"s3://npm-registry-packages"}},"0.13.3-pre.2937":{"name":"piral-pwa","version":"0.13.3-pre.2937","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2937","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"16a3617f9eb36756b31c640fbf503e5c0f30e6a3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2937.tgz","fileCount":40,"integrity":"sha512-ub0EsN+31jr2DY4zaACTTWx9OUVA283JyICUBAqiZmBieIXBPyZOxZMEWRtcih8pb16kEl0TtuPo1dCQeoxfpg==","signatures":[{"sig":"MEUCIQDmTb5Njb7yuodxIUb2U/44yvadA/dJ+uSqZyPTGrS7RQIgRR1Ko8r07dAjeTXGUsDyTpvngthU7dUrAsajGvbZkqM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAU+LCRA9TVsSAnZWagAA3J4P/1oN3yjyPWU0YEVImeFI\nV09wSxLBVlZsBFdBuf61FWojJraxnqPAPXMfCu13BQhUWtsy+awMYOdJey0X\niLIi+v1WziUXMFDa4dfLZs42Z2hs4lEKlNW9v9cUpRz+7HcY5iILA75ikwhk\nbAjupGhSnO++qgQBpS+YkgXzcpZ7+eZ4Y/nK27RtD0/YikeIKXHW3X930HbQ\n8R8Cj0lC6dieKolUGnl8w14QBCup3N5y/AXeeZ1xtjsqi0wIXYyezwkULSLA\nz6Aj300eCdheLtquuVRAOtW92ioRoXx7Zg/LUGDlauMW8WX21mRDbfFXSNMt\nU8pgTSYdmp23kitHn5ue06V3jbTGaOPwJInYn72scmMroP53OVgxouOx9KNj\n7acFFMKW8tjwCbe3M/oAfPbBBXPV7c318XtSsTUQs0RJ3wGMVe05ZdCNt5WF\nHpIUDTxcwtIwih/EtDBfi/d0KpVnNCSoBgEtBW0floDt8me6opbzHIG4P9g6\nGI3AVp4H6U55aJmDVDrE86XxAWtszmiA/XI2YKrA/svP3rPucojd4IBFWP5t\nCxTHrVd6696c+33i2cSqDaHrtQXqSbPkcMESUz1YXN+EkVGyqXBjK7dEFmLw\nNAt8fvhvsfZOYxn2z3ff7H7B4teV9LhpXk0ix9KiIdq3j6sQHSecG36x5ErB\nyqBH\r\n=zC0r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"625e6727a49d66ec5eb33dba0a7829f1f3d318d3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2937"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2937_1627475851298_0.09268692329709904","host":"s3://npm-registry-packages"}},"0.13.3-pre.2940":{"name":"piral-pwa","version":"0.13.3-pre.2940","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3-pre.2940","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3f310791ce8cc3166509fc1ec357ab126aa56067","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3-pre.2940.tgz","fileCount":40,"integrity":"sha512-rVt+uOCkzZkB7oenL9w5j1b9zQjZ3Kp50tvbqQ5q+KgzSi981sfkaTwje0PVh1PkYo6YyskWMSJMcNzpcmcyvQ==","signatures":[{"sig":"MEUCICvWEotpmI5HC6XRTgty5ZTztpmahkUyaM5KR+ynIKzsAiEA9a6PiqjTAyWKwRcmp4Lz/Y7KH59BIl4C6G3iXu8+n1c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAco5CRA9TVsSAnZWagAAvisP/3pqM1FDT5/f2AHhHN4g\nMEFOTH19ONDoHWMJT+Ea+bVVTXzyD2teKPuOu98dmeSBBTp8sOeJz1LOZYNc\nPm0ZdrqIYA9Qb4rp7uEMU0P7we8uq0Q2/836vuFglHI0PqKW1ejBqFiAmrjb\nZg/mopyoVwJCa3+mV4Gfm98eCEjhGx9hQxKDe/8lHaO3XsvUclhx0lwVDyuq\nQht/6BywrGkaj1zWIIrBaqQhRVHenMXGaMcBY+dSPUpybxd4Cuc4Nu6f1bXj\nwlEhMpKyZzeSTwjfzehJfeN9f6OTlbRVJOrkKsceErDAFLRZxn9ldvMXGBvV\nEnxskyeaGJEFPtJGOiRB+tnCd9B5CaNI9EmNw2ZaKQAtCrspX6EXuLwlrjpv\nLVcJdwFO7m4gSHSjga7F2e+vi8yYCCTtr61VAHXcx4L85U78NxgvYFb4TMbA\nNf/SA33loWlNAnnDrEujORmA5h1+xslz01ggcFB7vdUqpVG7F1Z4tPldEjb7\nsxYRMO63UIt7y/K+xYidAL3IF9pMvCw0r+D10yR2oJMRjxbUZ1/DurtJTAsJ\nPwdn5GvMf+ZDJjcreMSZGkAJbl0TxJzTAxSOoVB1TNUutxi/AUHsSuOXcKCD\n1z8TvmEJsaFfvGpXpCABbAVyVpnb2FYSHZuytHBSAzkgZQ5GXRRcmnRW/CxN\ntbS7\r\n=b9PX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9b949fd35ced6311b8c671dea19c099854df30f4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.13.3-pre.2940"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3-pre.2940_1627507257125_0.6651869491043081","host":"s3://npm-registry-packages"}},"0.13.3":{"name":"piral-pwa","version":"0.13.3","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"12ef6390821f4d5ff37483f75d8c7c1532f0c9ad","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.3.tgz","fileCount":40,"integrity":"sha512-xWEcZTE8/l/DENtQE+ddYQ1dzEoxfoiGceeO9a0lhxMZXg9ZddeAEApNLk25Af9kBkKhaTXfrKLTTgKXNyW2/w==","signatures":[{"sig":"MEUCIBUBhrKCDmrkVOCG/zuGE9VXtWnt5C/ZejOXjfXaTECjAiEA22sxKQfz6TJq87pxiveAwSF0idBz719hEkTUipyNXuI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAdUSCRA9TVsSAnZWagAAzi8P/RvRARK2zYRy2iL15eav\nBTDCDDSKjv2B2mNcJSgbcJ7kLPVkF/oaCBzm1zcR/H4tpicDHD+ML7aG3Frg\ndaamzEMVUv3zC80kalpHG9ik5rKIYGpPiwzUa8v7MIprcYDlK+NRWxszz/lo\nRpc44JG6khQTCkptW7w17Y5mts9CkHN7KglB9fM0VNgF8U1MRwhl3XPV7Tp9\n4k440BoFJyII7psMPHNK8fBTzj6SNETPniwM96s6ZkE2Au6fjQUKr5Z9w0QQ\njCCr/fM4VKfWFAUFaAmeH3/g3EGIqhSu10DVBwOmvjbUGuK2SVsG/HN8ioQL\n8FW58B7pZolfncexsMPOEODlDMynYsbzxKXVY2HqUFsha4i4Y47udWc1XRao\nyX19yv/XH/blx6EkN+dui3CMRVl8d+/3rR6P/Z2leYhrFaIHonJdx6NzeDQI\nsTbjmXgk89eX9YKmWftvadiWC6LkMVv+FLheVCElgYY6UMUw0eL34NrK5GUe\nbxxpzipOFAb8qgS6O6+3tGwYEjpm7d4xf0xgdqwgdJPvPRHOILyGV2citz0j\nN1z0Tpf4TT17+I7iST63RAvKWfiWjBODM4c+fjrO/gYumMHJFfzUU/z+mw1J\nz+58dueFX3Pp/od64lqcrldlOU/yAbWrLv6mmiPD0bdlRCI7IqGt+xDtb/YT\nhCKT\r\n=WQwp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"3328ba36e4c1c743547222bebb60b196725c87b3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.3"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.3_1627510033931_0.1455750736816519","host":"s3://npm-registry-packages"}},"0.13.4":{"name":"piral-pwa","version":"0.13.4","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4706ca2fe8fd53274c0950bfb1881c64c11c3878","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.4.tgz","fileCount":40,"integrity":"sha512-6+HQgGuMJ2dZe9W8x9wztSC1R9GiTeDViCUFWIVGY1NTnFwPcDHjNmnBlN7YXXwOPLIwdmLSMhIvX8PXAYcbRw==","signatures":[{"sig":"MEYCIQCuj3abNX1bTwl4Z8S1qN4gJeuvxsVHBTYkHNxue+l2XAIhAMvt9bcOBo/uI+U6VZCj1rtC+WGNPzRUHgMFYYDuu+mm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCF9eCRA9TVsSAnZWagAAQZoP/jqFS3qC6ItWcK+OVAnM\n09W46sLAArzCRdsFFMhdVyI3pm9m6LezUuVWkSSOLVDgK9roiYLRWT+wjL9U\nfnZyqkjRmLobaEJFqzCjIgcX+S5abM+d3hwwea5J9JJV8eLkSVHSuQYZiSBG\niaFtDaHhrPR9lu8L5YUvOyxaV5bVYcctb47OJBHyIyijSzYm9CM2TrdUkdi6\nI3V07N9n1R5Lu/A37kb2CzhwN7vZjaityvyTGY8Iu9ZUF6zEB5AIgxnSLx3+\nRzd2etWa/66feN6Eky+6bbSFHGkAPGl5Y5s4GGykLYEa9A4BMO/MAHvGqHaY\nizh2lQkP7g7v2AFWHOlpHWKwjRRBmjCSAACOy0R6MMWKZ1Lv1GUuvEqaaYlu\nWxpBLx7kEIBjntKyRKti8KCM5VHyRGiKl8nMmmu5ajC54pTN2i2CqWs71cHA\n7HIce0/SwGs/DxBryEkB3J3I5dux6QWuF967S6NK6Ve/+mbJOueG/xZgY85g\nscOlljflYlguNMIGjDMluKKTQgUKvq0GZuYvVCu6pg43TZ2bGkAM4GA8u+PJ\nnSyFYAy8rEV6NtKzSqkbRlEayHwzFl9l2ntQmrQU8ZmmSbPY5AI09LPMiQnk\nQIvD5F8tKnygn98TKE8tO78Qpqmiw/Nm89/vFj1aFYT7OYzdR6xUySl91Hdc\nhSop\r\n=8bpn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"f87a79fcf792eb8fa196f71d2e7a64840bedd167","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.4"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.4_1627938654360_0.5283331679509957","host":"s3://npm-registry-packages"}},"0.14.0-pre.2964":{"name":"piral-pwa","version":"0.14.0-pre.2964","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-pre.2964","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6e0c16da1ca73a6b3b73d46adf2548d036e74e79","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-pre.2964.tgz","fileCount":40,"integrity":"sha512-dbPzTxwP1/xasSyk2dSEh189woNdHDkIYNqsg4JmaPBt4Qq11mhkQrP0rl/9jQyIaev5BZOXrNWa/K+Q2RcprQ==","signatures":[{"sig":"MEYCIQCQENKWjti95LSyFXBNQcDcCl+FlPyV0b7oUeHTEcwrcAIhAP8d/j1lfMH7c23vdQG//ff90nrrabuW5q0YGC0FyRCL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDS8xCRA9TVsSAnZWagAANk4P/2TSa5UyFR3PaDWiYp/L\nc//vpNzSC+JF8oHxScIVs2RE43AuCaqOCbtI64M5iGpnsRIql8Fa2hAAkTJp\nOdQw69bOxWTOdodlVruvj/DURkqsl5HaQPvxdPaQSmTa971aWuF5zUTpVGZ9\n9hh+zVU9WfhOKxmC7BlHMRp5KABY7D7Uu5uRgsI8vACbJTuXci08E2rHKxUg\nfhj5DSpPQx12xayzJGIjmfX27dEBl43Ciczj4qloiYt0qEiZd28rC0ufr1v4\nFaaHKe5PqZGZJDb6xN1dUs7NPfmW+x41z7F0P1D28uJ8R7ANQX/+ZSC11kTo\nAGBtr3ms8AH9vqrL1XXgzgrQxb6cCNkBnmjVs/o2Y37u+3YYrvmdEtjiRhVF\n+EGP//dntcbmE4H0G8nKya3ZdGfmRX4visCVF0Ab3fSRNpqTqMCXy4Ohvjfc\nMRhc3jK+aaOMn5f6V0BKIjPHtgBADPLPiav6iPZd3EYS17ZKQfSa4gud7wr2\nasV5VH4X1SQN8hU1k2IRv4U3bTc3ZqrB/ES5zeRlhM1oDonkdUp/vUwZxutC\nx/z2GQv2DRgrAIVucvdQVJmp7Yqdiq7/2+MXkGj6ZtEyw7Ge/Cmq428sKWDz\nJQrovo3tQs9cEBONRl1iBMpM9MX41c60izgbi8iiI+UClWG3QkaocN9B1uVx\nIUj3\r\n=aQfQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"58433516448eb268bfcaf45f7a47e1e337ad3fe5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-pre.2964"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-pre.2964_1628254001745_0.25623272293666277","host":"s3://npm-registry-packages"}},"0.13.5":{"name":"piral-pwa","version":"0.13.5","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ba3d0346e888db06ed6f348f6cf1d2a5bfa4f907","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.5.tgz","fileCount":40,"integrity":"sha512-NSpeCut9eU0QuE0JRsvdawF9D9ON+CslI8/fS24xhDXrCIF587qmiUKL839HUDbi8Ry5WD3/RLJTgwS0f34tWQ==","signatures":[{"sig":"MEQCIGNkdHTjTzGOgHfTAMQ8XemEJjM8GD9KCKgCqkgMhGkoAiA+iIaBoA8IQvR3n191YAmvSgVzNGnr7V/zkmTjNgg+mA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHCwxCRA9TVsSAnZWagAAzK0P/3e3o65GJKFAG8I2+SiS\ngfYfa4WZ2kICLqRzcrX84kxFvd459kaCd+72TyjgoC+LDh3yuuH0N1r3FuVD\nPxWYW6gJQ5RvkooWtmZELl0k5R82MlzY7nZHSbDePQil7whUAZxFIM8bYm4a\nuMWC+iAERg7d62SCXixOs0bnAtz8VxT1wBINWjhryekNAlTZd3IRbgmQ9a0m\nhsisMEY7F+Cz+Q0ks5yvKfDqfbBTruQmydJ6r1p5tcK4m3I97jcLhv4feM65\nWZT3/KJUe5QORQM9/NmgglsLPQP7Puk0IhR76KAdps1a3ihLfWxsWb0Gq3OE\ncx9d8Q2scdnApRbqRfF3TPLR4LxU4ZJtAoI10XBYwJTy0Zj2/KVcUMrCoYnG\nKc8Ys+cQUqqQCKTUXeNdr3KhT+gkRWWN7EhcagMDATHKnl+huP35wWthgo1v\nkesPynTYY8rX2e6BHStiEdV1LjhSINwj11iJpN4nunG9kf6TjW9o7ycjiaxX\nUflrM1iLlmJHLoW+V9dGsMH3OOpePgW5B/wGQfC/B+R/Dilogbh7+QwXFU6Y\nOX5roabL8NmLzc6VQalhvEaeLYcWEqn/RW6P+OwbHGf5FCyAS287E/D3tujQ\nk13Xv3LqYmfqdin6Hda8m2lBvHhmywiBT+CV7TIIW2iCNVHgLdfP3zrRDM9/\nM+PQ\r\n=ZaNj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"79c0410ffbaa50756b71db8adff639b55c98af1d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.5"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.5_1629236273101_0.4677828866534761","host":"s3://npm-registry-packages"}},"0.13.6":{"name":"piral-pwa","version":"0.13.6","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"389a3ba1caf59a8243ea22f54abc430a5c1019b3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.6.tgz","fileCount":40,"integrity":"sha512-bS+xre5m+YolHOKBA3GZyCIW+oWEJo+BO+gaZhYpn6dVWUjykOY5e8SmwXDg1jTlYDB9G6DC8d9f8QajLxn+3g==","signatures":[{"sig":"MEQCHxhvCBLQkaLuwLNopjLTJGAnH6B9tZ6krcSZfQEEKM8CIQC0wyMYt55LyMD1eq35H5DJnI2Cy3NBt51K0xt8oDFuJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKL/5CRA9TVsSAnZWagAAZM0QAIwc7BsXzhZBS09zcJcd\nfiqXkklQ7sge122CYUvy0JRPs5eUlLdTKSbR1ndkJwnISre9e1+AZPTfPJzE\nMjeFPFFp4cef4rJ+kelQv9whqlLrDgvjPrmihPcMPkFyffqUDkA0FBZAox+8\nsrQAf9vwSIzx3xDVOW5td9EJSQoFXx6pWskElPoAzUxjkeO01xmIkpryIo0C\n3Kh29t4eau9tmrH5h0lZ0bBRnaYChX+G1fEW7oLTHZG0YEWSTIJqVxj3gHMf\n3yqgE03HGRIjCvIbCBlNdujAdBHSO12HVNcnMKvS74JCEOPAM7xnwC8nKVYm\n3r2pSBotPB4UAUoNMsnHLj7v7s71xmWKruONiUvwT5AiHOSm6ovnUwCOVvvT\nxhTDw7Hesnzfq23KLxgu2qgJwgl4KA+WShIQ7IwLY577AJubIh7JbQ9Doohl\n1+MecfUAiZrQMaq7jj5tsu9ndQSFDp3alcqvKhNSwLwPdlCb/z+ujnk/hhLk\nlDrh3tLLYe4dXfnOy4OEdyaBF6kkj7aIHeRP2m3ctDg3IPD9r3HzKTqF6erl\n9tO4rfd6ETM8Y4xaCEK0axJu9VbT0C0HCFm+jWPgKkopFYOXsoWXnQRsC+8g\nX0Y+0CxkApR/TOkRzaFdKs4Vnw7J8QaVJ/4ZJyQNtvQZ2kV9GbbYk4+yiV8V\n9JlQ\r\n=Iul2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"11c066bb86dcf097171236030d5aa1431588f537","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.6"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.6_1630060537029_0.18348015389691064","host":"s3://npm-registry-packages"}},"0.14.0-pre.3018":{"name":"piral-pwa","version":"0.14.0-pre.3018","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-pre.3018","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3ffe3ed8000b6542b8e7e271409cf527b37b270b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-pre.3018.tgz","fileCount":40,"integrity":"sha512-SCfjkvH+8E7a6drNFnVefFRm/rYmzgwbdTJ7sK4bxKFq5NWZ4TY5dvBH9oL6HjJyR2JiMmJV+7KYCR7K9lexfA==","signatures":[{"sig":"MEUCIEqywIzDDetPFjji9CLSKxNNHXu52VAaAQS3ei5t67+KAiEA+OrLu8b3iWOZtMUNAw5lbkc98wXpmTbcMB3lxD0GSuM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhL0X9CRA9TVsSAnZWagAAunwP/0+mHvkWFkYyDnnwZXmb\nplsx9khnB9BOJphM0yVpIuPM8I8oAJ+PIcOZ3kxbduUc535+vjcSbGv6ND2N\nf2L6YLXPWHWeY4XmjsJx2CkvFx6OEOvq6ThuW0G13ZduuZ758NtadsKNkVxc\noCJSMGP/auQzm8YepRHz1d8csE5vJPsqmbwV1Q4sWBUf6SpkM9TvxFO5XaI+\ngaUyjWCzy4Rrb5bZTpTtUJeWimdLqyh9i36b2A0xO61EzlrNmn2xR8wJ5DL6\nwsswqrKAUTzLpWV3Z0rJnNIF/uSz4HOsUy6nfU1hSrD22xWF5GLXIuwHWNTq\nYSSoKfUsnoxyBjjbssmmk6lqu2ZL+GZ+kY96agJKxOhxLqR8ZgPKq6Jr8N0T\n0dU+3PuC6yD715KNYC1qLTfyArgSPBKrCh0sNMFp/49fw52wOnjDcCQSskNr\nhjrk+wghbJEY/YORq609kBE0i7bx8VE/m5bu5RqMGmiRBUCJlp/AdcQzQueN\n1bq++W7hSRwPzHEDw0bDSXCBiewJ+qaS7QLtlyZJlOXmgYnc6f8FRoVpGp6W\nA8CwL5k6n72eh1N0NuD3nCeH4cQq/qinDcmiuovmfpjlrQx3KPiX/Fel88zm\nowuRuNJSi1bWqJMOXb47Z7I7gjXbg4z+5oX3GTYng4YHFr0Tj06AYMAFPx0u\ng3+8\r\n=CCv1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3a4f0583993a705a5cfc103f8a673e906786af60","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-pre.3018"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-pre.3018_1630488061528_0.3521207153181487","host":"s3://npm-registry-packages"}},"0.13.7":{"name":"piral-pwa","version":"0.13.7","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d346fdda07665d819e6226f5796f47d930da7f93","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.7.tgz","fileCount":40,"integrity":"sha512-aBv6sHdKwjcN/4jBmUDXd7O2QvhHF0+SsEBJA95p272lazpabD3B2Yc34R7hQFgUiDjIjfe36Vx05yp9AQst/A==","signatures":[{"sig":"MEYCIQDRb2nJQi1fbVdq/xGfkKw5n0k9dNJ+ZWU4Qgtcs9goWQIhAITZ6z68uI0R15GQ4eAV4desSn+r8xAoNv9IDyAe2fxY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhL2jOCRA9TVsSAnZWagAAi6YP/j7SC68S+8aIRNvrYwOZ\nPbRK00RgAaYvbzTamEf6bTfAQaxHU8epHGJYcTANzT4ZcAjptvjZCUE+931O\nl5ZDIJ6N3skeloyKmnBhXMGKZec6jKDAZnVdnDkaouOqD7h8/5YcVGr3CG3X\nesSnlSy4b98QJHvgIomr4IrUt7eypVNUmeOpsGXeLHaXhuIDOckHVr5rfxmw\nTs+pF/r7QKuEaEvnsMzcuDtwn2VcgFL5ZMioMxpeRVBPuD39Lzf1ieFjn3PO\n8+zcy//ZbNBpLjBQLGj77IpvARbcV5CSd+OgHnnMPUFUZ1/lQQthRbMeny8z\nL2ifNcoSWv7l8TiICfHlGUez6LoQ/1O9+8DXgqzPNKwWNPhn3SLy4TuHSF+1\nqVB6kaYG9ysANdL243fJAbZEkN8g5b6q2rBj1CN/JlHOBzbSJbcY1L0d1h1x\nhEscUR8uF7+ekPeJy9l2WgkCW1L6oZGSgMFGPaYIOs6wwjbpDCbi3xukk0Dq\nZ6WsRZuFQewi2/dvVzcUbJjNrceieD0nFma3m76n5G443SWBnyGNl1mV/GU+\ntg7r9059NISCwnUTu0guVk3gHdU1g1UVRPQYTDdUY8GmrqNEMpftnfxfgYCk\nEhKp+58fNlsnacdqhKWhNrkEyOQkhw6du3ILHfuSk5y0Wl2cchmuKgxaQSfI\nk14K\r\n=AG6+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"201de6c1cddaacb1e5f9646bdd17dc43acf09e8e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.7"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.7_1630496974767_0.27980972008813754","host":"s3://npm-registry-packages"}},"0.14.0-unstable.3040":{"name":"piral-pwa","version":"0.14.0-unstable.3040","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-unstable.3040","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"01c70809f6c3fb2fb60df3113058fdf793e87b45","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-unstable.3040.tgz","fileCount":40,"integrity":"sha512-rR3Pv3ILIUw+skREtOVjr/uJlbabL/653Rp87h6rHvv89qINdkJtdSB4ovFmq+i3FF8x7yjiLBaKsxIOvkZjXw==","signatures":[{"sig":"MEUCIQDRudiPMMPKDjlM0dgJ7U0KzNNJcI3UbTrIx8m17cCdFgIgOHTxdnxMW2Qu3O/gDF6XSH/k+66V7zB261JMzZ/uBWo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOyS0CRA9TVsSAnZWagAAE1EP/2Gw2gAIlUVpOYdc/rmP\nqY7HZPj+dx6TFr0reSQ8NDDLHzdPPYjVXZPsJ1xGiThUFtZpRy31HsTb0qA6\nLoKAQS4GlXyskQKEIt6h7bkDP7x6/sW3pgo96mK8co+w7iM4ZZcsJvEeDhP2\nJSBGzsi8zCXLN3DYHcVn/N6roYnSwuKBs2/FIeywFuOcDeHgQlBz/NYiYJ2R\nYOBVatjqSvG870hepU1MiwWVKAPMu4NokCqfaeFMREJGfunLFQDVJvm3ov7J\nkW77mb2+K1bDaYecq1jkj1WLd58MvnIGDaryyI4CiDH9q5EDc72Syi/EDzVQ\nV59QeAKPsV5UWUHKi+fpVRFPC7FapJZOkMEUkWKRQvummFXWAarK//BJlgC8\n6ElW1bqtgwXpojs5vQA4RXic6LwjxwzNq9/wEWhYAazY0ax3+7wzWeEXPhie\njklvqDug0++TGdoSbeiGkdINENWZ1hA67PxlWEz5SYX8XESs/Or0+or+K8Rm\n6SKGSk+x7qQ043JaIQvLO/GaiHiTvM+/mTMdBpgul8T3AzOBP9VGUMReZbn9\n5TD6L7OMRGyhxLdKdANjR5T7w5YTld7MM84ptkPxAepa+17RjY1TEwmZvDH1\no8uiZjjC/cvN+zDFZAo33auoTOw+hmStdVor4wOQ1uT+SCNryFuLy/cgxqaV\n+ZIl\r\n=kwpU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8ff4c5ca1610ed9b8e057bb717e23d97624093c0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-unstable.3040"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-unstable.3040_1631265972446_0.026728751050504318","host":"s3://npm-registry-packages"}},"0.13.8":{"name":"piral-pwa","version":"0.13.8","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a15ce104444a63c47d51f57c1c9902b726cfad45","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.8.tgz","fileCount":40,"integrity":"sha512-Wb5yZIzmBXXcxRkYAQjqwrGDAazwVuM9x1/ogEHimx2CZ4NTmk1pBqEaR1NwOnAQa4bpswo538L5F+pViMHDRA==","signatures":[{"sig":"MEQCIBav3yyHW877tq8TUWBKFtbrIqt1u28r31FQSgUV+EOkAiA0bO5m1Xe/NRQ4pSdzz6DkUqZRp8qwCGVJnr415GWjcw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhO0YxCRA9TVsSAnZWagAA0CMP/07ERflmVol1ixM2B/i2\nXpqg503yELfmmmsWXkfwX2fZFLBCiKvI6dMp0pSq7RsatR5UPySUmx/2fiw+\n5JmFVKUJBMqUrqxgFRKkHr4R9ZjMt0XDKBYwZi3mZM3Jpce5EPeRMNPqW8y/\nPd3Qf7PazZa7bGKYYLugvTzorAlN0+uIoaH6i2WWfC6TsRR8qIgihL3NF0N5\ncq1x7+z5qKtImdnm9yTpqAhjEpl5q54fd4TwHEpbwt0R2sDwhKABlvEVXeAe\nrTzJQxnaT050aTDKjIOaRYBZkCpvj01qEjNhmMRJUZ0B/0Q47XfdponVMRmG\nbnMH7BuOPPmm2RTlnpd1IM3JW5P8KhE5Y/LfcZso0+Jqyr1Is29nZZEII5RB\naflB+0NVCElZKDuj8uymYHfwauCiasb1/38xaNnV3bZLd29IGmAJsLEJqdPl\ncK2wqCJzR5MpNeeq/vga9Djd8AjgGFO4j4bV81z8UkIqx/2nBwqFvqkIqxmA\nf0n2f4hJiDTjZ60B33yxD4jLPfQ9o1857wDTQtLmwLG8D8QPgvKZesy4A5cN\nzxwhDzn0hZMiKvDIVYdZAj+RrQL0MjhOo6S0yIwggZj+gkgw/RCo02z4Asq2\ntUNS1ofVKZQGfwXVOsLaHJVqXQKBXM+Sq40ZQK22ozUuffQMK9RRuV6+u6ml\ni4+b\r\n=PMf8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"26a9a75314886ad9d81ff9d17b5d05296af3d04f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.8"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.8_1631274544863_0.2503679450119469","host":"s3://npm-registry-packages"}},"0.14.0-unstable.3058":{"name":"piral-pwa","version":"0.14.0-unstable.3058","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-unstable.3058","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"46d34ef88d41d7cf7cd3b573221171e1f470832b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-unstable.3058.tgz","fileCount":40,"integrity":"sha512-4AozxfoJoaGPt/M5m2m1ib6chrtEeZONxs/x2u5eE52e18jf4sfZJL9tk++fm9134n+Is91zD2dzfoTx5mMr2w==","signatures":[{"sig":"MEUCIQDtUZDbmHE7NqyXWkseAvTzkYSp+DRvtioryHMJT9sh6QIgQJ06bqfil+46wVFYy5aIuz0Xkixfi2wwqocHtAwFCRs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP0e4CRA9TVsSAnZWagAAtMMP/3SbmLB2zMvejjw2fEZM\nqx++2QpLsRgWRGKrwUPtzGYoRysr128k+13QISPLN3a32U/+F3NM2FyN8egf\n8ErZMYOgHYm5pMZzVaUoOJ8WBSI/+DSLUk0NBuEgQeD5Hrjryhjes6ieky+w\nM9UwDgSoip01Xz1vOGBzrYhKJzQbRqkziPKwSZrJIYI9pOPUo5g5VDWu56Qp\nPtmk0dsMunLr4Imd9CTuQnRb9Ji1EnBE/VA2AhMBp0fBcnkmqtRQW+NRW+RV\nI/CLPOdor4+xRgUWTc3VLf2XR4kjYhbPLrg3QOn78Z0LI96BhCZFGkYi+eTs\ntzeoAEoWapWCtQzpp6N7T73jqw0D2066fc2TTrc5hXteUdVSo98YKIKHC9ps\n4rQrEf4xrYuJ+BSkft/3zW++Zb2sI46IUD3yaLrKJhm705P4FJLPOxFstlYy\nWOEmn73EhZnYzJG/UgcAJPfcTZI3bYNiv26tqA5soPWrBlCdcSDc1nKeiQez\nTIykdeHPy8dOUhBy16VX2oJSBkbR0j9Y0/ej+y1n/05bgdfRDhGmDWLsHSDn\nH0lzMB0R3NM1ofQXZeQGEcxOjh/ppski1zudS7OgWXDT+S8RofvXKkftJM2b\nkGqjr1a0HuPtWl/niIS5p6ZSd+IZl8T+7PgISMFFYvrSbUedeEe83cOqgQf3\n4ww7\r\n=z498\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a1153691ac7835bc7c8569ca65c56d8027f094d8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-unstable.3058"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-unstable.3058_1631537080669_0.9988790842685842","host":"s3://npm-registry-packages"}},"0.14.0-unstable.3062":{"name":"piral-pwa","version":"0.14.0-unstable.3062","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-unstable.3062","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d26e02439f784e17600a7824aeb9c3a90f62630b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-unstable.3062.tgz","fileCount":40,"integrity":"sha512-jWUa2cPh2+i9ZoMXHIQ/xjokSlG+oCzesDMuZLe3XwdeoB15Iv6yBc7pfQt5P4XDW3vgWjUL/uUi4U5XiE+X/g==","signatures":[{"sig":"MEUCICunjzkdBlvdSBMTT59qn8GMd/9R8nwxWtZnWbNG1tlNAiEAuUXntdOoTseiAuTlm5OCKMwJHP2jWFJvOgny8GgSErw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQaaUCRA9TVsSAnZWagAA93gP/3tARtWsS+asg25OlTUe\neZ4Ny67sUFaQ4JcdwxJLrMFF8oaJ/ZRR8xAmx1XiVo2+RghFwrOMAWoimI09\n0UY1mRwaU4V7QSCir93XVdW6duO54DoXLjq1Ww8a79yo9BQc6qC3tqER861j\ngxMzGhF3MM7Pm8wN4UsKmptjm8ea9z9iEzGYfkh6EyAAF+QZwPYMvkQybHU5\n0aX7DzyW8oNF2x0ufbsgaaqslwCgYHC8RqtG6JPuKK+rQ4+dQSpO6gYxfe3C\n4D1+v8yRoK36lRQbV7YuOHr/TVswNEzFgRGPl/YFFyxHPQNkIszQS1R8UhSt\n6CQqdUWVHos6l7pc4jrOfqzsv7dnk/XCqEZmVqrCXg1go6FLtOS+I/9laIy0\ntrdNdw7oNAlPK1RgEzrdXQqymPcSiQUut7oKPrtPl0XUoo0cfbYuh1LMz4Df\nhhKM5Eex3QQNgDGow3I33ELtrHfbnXemEPfn/mWJ2h5+8hlkcEDS74JBBLxC\nduSnJFGIZ9xrdi8HEeLVkIgdgohK+8EM/hE//QOC1jCTADoASI4ErmbmExGn\n8XkmxqDE55QUT8ezGjVNpfSjq4LwahGI/+Z6Bd1blOGxDqcZEcByIcAf+icl\n1IDs5C6VjDAPWMZKCXdxFH3ycDP7NNqL4tO88qE7bMa6Iip+06Hn2P2/LyQn\naR34\r\n=cmsy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3c02948f10b359bec03366022a5ed09c86003a7d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-unstable.3062"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-unstable.3062_1631692436324_0.19971790799626943","host":"s3://npm-registry-packages"}},"0.14.0-unstable.3068":{"name":"piral-pwa","version":"0.14.0-unstable.3068","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-unstable.3068","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"af5e88d3611ac08738b7a6b59c97599e6dd78c3c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-unstable.3068.tgz","fileCount":40,"integrity":"sha512-gv38AZB+Erjg0bDtmXPW+a81Mko0EFzLz+Sb30h/pfCB/fqeze6aZqxdV+d/5xi0whIgEVRzv1/L8rwNsU7Ajw==","signatures":[{"sig":"MEUCIBfX1bIi6XBHfbTSCsuWR36J56qIpHqk4Pe//fMSEWX5AiEA8HUCh5uy4o1goIJGpomv/jwHb939CyMHiumhTqZaUMw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQzzpCRA9TVsSAnZWagAAZfgP/j3ykq6MS5h+Hs+pOhcy\nM8SWDodfgMOXF2HqIsUpc30uMYqudeS11PAtQFTBemxhBuH4Qaxmtk2ZTY9D\ntauO0lbnOh7Nbstbv9Huv7zyMwPEHhdVJIpmQsvz5GCGbEEReVWNj2a/PRS4\nDT7l1pWwcK7Ni9ZlaNuGnFPvXXIDHTjhfrozqXW8oc1o+2xA4yzzocy+JiXY\nDR2DNwl/CAMGwjy0YSnCHCd2Iv6Rvzu3DXQ44ykI4+R0VmOl1tuUf2QjiHZh\nMIM2Srwunp0mwPvJ4botOvS1tywexu3fqg0dlIQTvWoLRP4rWUDJoMSJnbbt\npD0Wf6HqDr36cBwiuGIdNr1AVsZBAJbiwH15uSlSRd9c+HhYL3Ha62zaRQYv\nvxSYGlKYJe0sedZt5ZlGyqPmdnWHFW3MPWG5zABa7dMA2PiVJSnpAjfuWLoL\nZbr2GSiSMfbVCNTNDd7zUGNfnY3ALJKXF6OtT1ml3M4JzNRZv6UgrInGz3e1\nCv7sdy4fbxKHqDLQlR68f2zlxK4kpd9U6BZYoDQAiMVJOFMCEn2g/pUKBvwg\n705SOGoYiqbjqjqMEzCL6EFSgrjD1RdcewSEGWlctI56B1w4XqKZPSv3b43h\nj1EgsFzMKruq1HwX/oUVqoL8eYpDTdGK0D5X+kpUJHj6PSt9VUT++ASm4g63\nG2TY\r\n=bL30\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e47522b04552ba56fbdddcf8b53434d3329da1c1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-unstable.3068"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-unstable.3068_1631796457353_0.9296293429829694","host":"s3://npm-registry-packages"}},"0.14.0-pre.3074":{"name":"piral-pwa","version":"0.14.0-pre.3074","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-pre.3074","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"02cfeeab36746e87f58b7a5d59d60b1617637a97","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-pre.3074.tgz","fileCount":40,"integrity":"sha512-zquotBBnCSRGi66mNlgmKPff9Aonz5ozOOBeklEjMmcnH6QzgpGRCKrsqxWV48+Hs8LtPHUqwX02gAwDm60Pvw==","signatures":[{"sig":"MEYCIQDbmivYStn6tixCQ6khQp+ML8d2R1SjZ6+l57nOgjAWqQIhAK/6YJbAH6ZcT4TgbsiKOPcqq384DtFYyFkOBKd+WdkL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59993,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQ9/uCRA9TVsSAnZWagAARB8QAJQjf4dfXM4gL6lol2NV\n7pdi755MEPFW+SnmHse/7ebt2mTIJsN6UJQffo9qwv6mvuksuANOhtNtyL99\nDW72K9SXa/1bS6c+zQslNOo5uCKQXj0qP+5UXCkeg7MJY0SEOG5sPDeCRfDa\nqp+mY1GHnzu4MvQ7cHcjONLPPwOR+H56JW6JyNpYzpvTl8XqYl26Ug896Ykq\nqnUdCkFzx7Ez2gBKe3xp0QX/vEh7TFeO3BJPmgJS287tIb1H24iZ0TNoM3Hq\nb5CQH8CCmTghrpXMpLDVc/TTrSu4rTu06MfyiW1tmq8wGgQ61/H63jsvDcGV\nrkoaC4G2o73+rr3i9KuL1zfUIiX0Wtwh0nppGeRJGtvVFaS2Skk1wslXceuo\n3H2T/bAJTGOCb6r++PM3A7SxgxrHy7ii/3USsAsl8LEMRSykM37lOP5xn5Sf\nwEoB8LPYEg3tr1CaD/uggYzOMy+WcQJtvulhPp77kNR2PQAjkPLLY1zqHtQy\nvLo5jidO4yimxm61LsU4yJZ0eQVDsk0WpbXQ7lr5xVDaTLc3AxsDJQubJf5N\nsCDUJkQXTozm4KS4sK1kMGVNqbPDSikPzj3zlX3n18kmK/tfVDVvCWaMengd\n/ci6ddx9yAUY8P7ql4flPxUwRmdkTj5PKRJShJLJw2BpB0G/cmHq35Cx4Mst\nHDhO\r\n=GOGJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"21675a37794efbd6ff700ba06821a67e840a0360","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-pre.3074"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-pre.3074_1631838190226_0.5364143326620179","host":"s3://npm-registry-packages"}},"0.13.9":{"name":"piral-pwa","version":"0.13.9","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.13.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"51cca32a4a95f33f4c2d18b2d602d729267a9a88","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.13.9.tgz","fileCount":40,"integrity":"sha512-DjX8BTVObiUBDdAcK2U4wA2NzWBJopx5SsW6jBAIlMb84LV5HTY2yZsKTZ3zsVkpLKwT3gd9wOJXqsw30w7QGw==","signatures":[{"sig":"MEYCIQCjwqm83n5TeaDVExAEYgZEA5DlEhMIr7/adZCIohIx3QIhAKHLRwh6TpCa1Du6/GVsAAhvXjNO6IJX3/ortUPeq816","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61122},"main":"lib/index.js","module":"esm/index.js","gitHead":"80de9fb69430283bc90f380d3254e0e6aad4c6ad","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.13.9"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.13.x","parcel-bundler":"0.13.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.13.9_1632430150573_0.9711790411023551","host":"s3://npm-registry-packages"}},"0.14.0-pre.3098":{"name":"piral-pwa","version":"0.14.0-pre.3098","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-pre.3098","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"996aa266004ab9e8381e2532417d097f9e77e827","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-pre.3098.tgz","fileCount":40,"integrity":"sha512-rqYYajkRuvYP8u+Q9BRttRLUXLhOzGn4YaXMYlCFH/XlZH7zemJtpxTEp7oJBzbYcMA2t0abTiGheonPWlKqjQ==","signatures":[{"sig":"MEYCIQDyS0ycpP/UBWlESSiWkrhndRTQPiemkrQ/Reg/hCx3wQIhAPbT05Ismwkp3J5nGnEAD4mReHiFlY5CPsp9Y3CZuWP9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59993},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"04745c29724e25e909abbae77d5d3b29461dad06","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-pre.3098"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-pre.3098_1633480703644_0.6562447477991613","host":"s3://npm-registry-packages"}},"0.14.0-pre.3122":{"name":"piral-pwa","version":"0.14.0-pre.3122","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-pre.3122","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"957cf089f5f653aff4181ef2c45615322bec3ee9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-pre.3122.tgz","fileCount":40,"integrity":"sha512-/B8uRF+i7vpqKH3p9AJWtZZTxbuZeUyCbGl7TJAWQVLe1ANCEjLZqi8V2jn9cRowPOou0t8dqhkWCNHVZDuMMQ==","signatures":[{"sig":"MEQCIDpYLHb4JdflMUjxA+h+oVupk+IN4VlBkfLBRabfCYWiAiBWk2NL1blJJD7JpWNsCFWwWPYWdBlnqfWAd2Fn59oxOw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59993},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b1a130c01e6f7a839ec44abbd3b98341ec55584f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.16.3+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.16.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-pre.3122"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-pre.3122_1634549514464_0.14864421546014794","host":"s3://npm-registry-packages"}},"0.14.0-alpha.3152":{"name":"piral-pwa","version":"0.14.0-alpha.3152","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-alpha.3152","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"},{"name":"nmalyschkin","email":"nikitamalyschkin@googlemail.com"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a4ec0ee0a15cd9aa925a129ba70f60c3096ce845","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-alpha.3152.tgz","fileCount":40,"integrity":"sha512-7vG550insuvebQ1K3OfoH48npHOF87KSpaFOoPE5m8E7VVAmPe7UKmCDMffFzqhAATx7ECF9w/vf0hXrWi5NNg==","signatures":[{"sig":"MEUCIFm9sx6O7ZKOBS4SQ+nHT+bvVt4Y4mabfTRxFbaMRYiCAiEA+TeNTrA8DUMEyGzQ7KsLAVksOaeGLLsn59ZGIJJf9AM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59997},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4ad88a8b8bcdee17f22e7e1e2e8feb41df6210e5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-alpha.3152"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-alpha.3152_1634821940746_0.38943947899722153","host":"s3://npm-registry-packages"}},"0.14.0-alpha.3154":{"name":"piral-pwa","version":"0.14.0-alpha.3154","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-alpha.3154","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e875472675423600df663b92318cb384f8963339","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-alpha.3154.tgz","fileCount":40,"integrity":"sha512-rMbnQpcxKMNGKdMKUI7UuPE7/T84WjLuK9UPmAvtGt0+FbH1wYoyKDVs8LWXDVtAHeBX+b7l/3HUrvIzArZZow==","signatures":[{"sig":"MEQCIFGlWN0b7KbwWxfF4xn777TsjhuosTvd73EvxT4zlw2JAiBl79kJLNTybkLCEcleczcwa5OwEOuxG15ats+cSGh86A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59997},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bc6cc60a59e6a8b1a154d187883cb794e8609939","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-alpha.3154"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-alpha.3154_1634893248401_0.5054786327877099","host":"s3://npm-registry-packages"}},"0.14.0-beta.3156":{"name":"piral-pwa","version":"0.14.0-beta.3156","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3156","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"52bbf9c02943a8f1e50387e6fa8c492d72c56a38","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3156.tgz","fileCount":40,"integrity":"sha512-SnkNB01+qGdphWm6GRbp4FOV9z25Et17CpSxVp9uDZEbgWa988ql8XiisAFC+8j8vtbYHEnoFHdK/snn1di7/Q==","signatures":[{"sig":"MEQCIGBZFcMixXCSVInj0dkKD20kGEHA5iuRcWKpES0tmTGfAiBpwAEvfNDu7hhr67UlO22CoJq1jVcqEqeHCLfOxIel/w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59995},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e368a181defdfca4722d7bd478a9dcd47d90a51b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3156"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3156_1634904648203_0.6516351823272473","host":"s3://npm-registry-packages"}},"0.14.0-beta.3157":{"name":"piral-pwa","version":"0.14.0-beta.3157","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3157","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c2ad7783686e04151411cd035f5a5dffa2c1f327","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3157.tgz","fileCount":40,"integrity":"sha512-tMCPONlwm3ubZvs8Te2eJVsYcHbecxS9JqcT1n3fDctMJuhb0Cu3EQfrPTwhlaRU3Y4sjO8fijFXYla2kieaNg==","signatures":[{"sig":"MEUCIQCIDkngv6ruwhbZA3fYwh+KYrDvJqOAaU4Fiw+TinAvggIgG2DIj4NUIyyuXwIIBXdo+SKr9Yfp96+47/kslEULHbk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59995},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1928e46becee1444f84df8e80a81aa12712d17e2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3157"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3157_1634914094258_0.9807195015465062","host":"s3://npm-registry-packages"}},"0.14.0-beta.3163":{"name":"piral-pwa","version":"0.14.0-beta.3163","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3163","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"26e59868ebc2f5a16a3ee1b3ac9ce738c8131c6e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3163.tgz","fileCount":40,"integrity":"sha512-jKzncnT3TrFvVazY9HW41ddT6REMkgO6ow7UojGZMdqX2QV/+L+zHmDKlEXKKhAHxdn7N2p73o41RUrFwV61lA==","signatures":[{"sig":"MEQCIEaGjSJe16hPKZR63YoCfNeaWf0zj4gVsUeu/QcdKprCAiAOO8wkiRbLOJ5fQ4RUb3d1NLppGKXW9W37LFGfnZ5GZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59995},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ac8a8f2d0a9be0be6267afa87521b90e98179859","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3163"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3163_1634943229956_0.8932911044134138","host":"s3://npm-registry-packages"}},"0.14.0-beta.3183":{"name":"piral-pwa","version":"0.14.0-beta.3183","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3183","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"df437eea058d6fdd58c38686cf2ea5b0ecc1d798","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3183.tgz","fileCount":40,"integrity":"sha512-GNejLPtsvk2ByVyVOx+tJTzSL+CTM7CY3h+znd6dxpx8lUqoC6M+fH33dshupUmC+qeosfq2jb4k0uA9qQm0BA==","signatures":[{"sig":"MEYCIQCLCXoibah8veHxim0pvTYS9iji+eNEqqVhvhnvfthrHQIhAMhgDrlUxfrBtamY7U+HqDnv/PgOYgaDBZltCaTIsbKI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59995},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4553e585d9cbb9ebd71d032a8fde55c305aaa268","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3183"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3183_1635349724521_0.2617057665777607","host":"s3://npm-registry-packages"}},"0.14.0-beta.3184":{"name":"piral-pwa","version":"0.14.0-beta.3184","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3184","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7bcb2ebed49ccaa24f6a7e48e4d99269d02b025c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3184.tgz","fileCount":40,"integrity":"sha512-GfdxbdMmYMxIdFeGzCGKCZfEMgC4+5oIwWfax46j0zqlXOdSbTwWXZhIW2wwtjTthn8I//zDX39z647geaTm7g==","signatures":[{"sig":"MEYCIQDHFjg8r7PfXW11h8gaP5z59v5eUwYRfjO9+O2mu9oRMwIhAN8QXeJf0FtDS/+/Io0ybG8vrj9uQ5C+ZQNbREMtNIQ5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59995},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2d00bfdcdf47c737ffb8d58f700945362ab9ac6d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"^0.14.0-beta.3184"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3184_1635379934262_0.981029746091514","host":"s3://npm-registry-packages"}},"0.14.0-beta.3187":{"name":"piral-pwa","version":"0.14.0-beta.3187","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3187","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"39f13c544f9b599afe8bdfa52be01bc4f64d7ee7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3187.tgz","fileCount":40,"integrity":"sha512-ZOcm9bs1SM4oNCdwfeTVXA7nccNGgFGSNdWnUr610744eHy2ERCcnCQvmYI03Pysc/2UqYszA0YL+f8A6Qa15g==","signatures":[{"sig":"MEQCICoBB54EMH/KF6x8EZncemnV3qMnsQjH6E4tuOLrSzUyAiADXfq0/xyixjjT3usqEKhtBfsffmahveGbhS8IG8rOlQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8c7afcbb45ab9fcb2dde5d8377416ff3bc86d3c8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3187"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3187_1635415810926_0.05668928107812787","host":"s3://npm-registry-packages"}},"0.14.0-beta.3203":{"name":"piral-pwa","version":"0.14.0-beta.3203","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3203","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8c3920cdc769a38a570bb7325cef8983808314d6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3203.tgz","fileCount":40,"integrity":"sha512-6KO7EYe0VdLlPxLAlVecO73ielJw3mid1GSY+1AghBUfj/6NCQjc7Z1D/iO/hKXRs52w/DfTQYeB4av9FxdQ1w==","signatures":[{"sig":"MEYCIQCLdIhQWCSBRKkK2A8Uug5KIv357wVTLvCrRHH641CJDAIhAJmssllXDIfc4cFfK5DVJJkiZppB56pMEaUJzdQyr6U/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"dc0453924cdf43ee3f8049b47f6562fc295e9ef1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3203"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3203_1635462616518_0.602062793438082","host":"s3://npm-registry-packages"}},"0.14.0-beta.3215":{"name":"piral-pwa","version":"0.14.0-beta.3215","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3215","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"484c0bf29aa83c0a32f6a5c739f6e24f944e9389","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3215.tgz","fileCount":40,"integrity":"sha512-x2D3ig+2NG1+sQGUB9qtDDAk+4HR6qVvTh6D9Bi4hmUvztuhUt/j+iiQ5fPRFuA+Nl8o6J2wSDSfe/H1C4guuQ==","signatures":[{"sig":"MEYCIQDsAfnSaPbxux9+ORavIaXrFRZLSWabJz1vtW8E2Af1GgIhAIdqHpqMRwihTY7i/U2MVbQLbJQ8JU34MFc2GKh1LNcy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"876f3ed398a5452dc3eac3c030ab5af4048aff88","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3215"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3215_1635540008128_0.6444822921409756","host":"s3://npm-registry-packages"}},"0.14.0-beta.3216":{"name":"piral-pwa","version":"0.14.0-beta.3216","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3216","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"efd2944e397d712b6e1dc8325f801840a36b929f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3216.tgz","fileCount":40,"integrity":"sha512-3IU8C617ekty7CcV8gQXhfesGhgZQ2Fn36u7sG0X/Zr3XYes/ZSuQws7sgZBa25hIgTAw10RFjDkx7skXT7+eA==","signatures":[{"sig":"MEUCIEFsA18B0LNOy6aVWIP4wpseQfVBY47SYfypeLw2NFZOAiEA0D4oNd+ubkndpvQK5jLsO7d2yM4gMBs1stwnWciC7ww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4ae646f90377893373f4ebc575eb0b8a707f8b94","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3216"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3216_1635549919992_0.789339023653095","host":"s3://npm-registry-packages"}},"0.14.0-beta.3217":{"name":"piral-pwa","version":"0.14.0-beta.3217","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3217","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"860ce5ba7db1e0ead1233c08ee0b66f3422d4bd3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3217.tgz","fileCount":40,"integrity":"sha512-JlByVD+DbOxdAP4uwbFP4YzG9fbOhIppNkWyBTARB75drIQ0McWYplvbFNKmSgCfH1ub7c1tdu9ihJ+9AoeJRQ==","signatures":[{"sig":"MEUCID2zCRLSsorymfNwWQsEl0mBQyTMOLowCM+1QIxLu6uaAiEAix451I2jmCrTesto98LsRdwBaiqBroLsRnOf0tbC08U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e91cbf791838b7cc2feda16fd8965f1f99a1e2dd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3217"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3217_1635647879910_0.7412759571915306","host":"s3://npm-registry-packages"}},"0.14.0-beta.3222":{"name":"piral-pwa","version":"0.14.0-beta.3222","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3222","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"94cf7e022dd6d94a2b6a00b2770b6aa903ed8060","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3222.tgz","fileCount":40,"integrity":"sha512-xRu+01hddJMa1O6fgz3eEOd6KYkZZFe/oCP4+VfuEu0F+rmPPqKnwB6866JmpCBchGh60KhztTTs2rJQFnaDeg==","signatures":[{"sig":"MEYCIQDoI1aqkEaF41vn2dBs1RcO+tmc3BL5Nmkf/WKir75D/gIhAKSnlR2MV3rHeMS1N4cBmTyM4Zmk17G4SoC/MeF+i+dd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c3cb8ee58b51d36fd310cfdf32672ce460157b13","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3222"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3222_1635938300313_0.803411081574158","host":"s3://npm-registry-packages"}},"0.14.0-beta.3226":{"name":"piral-pwa","version":"0.14.0-beta.3226","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3226","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"28e266c87bbd5999068852be7bd27996f421ae20","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3226.tgz","fileCount":40,"integrity":"sha512-iMZTyeQYhzXOnRH26X+Z1RsuAvYt37zLrQlXH8+B7LNWlo5x5hDyWs/9M7Cn2o4h7m2ghlu4Bbgheyu+a/46Og==","signatures":[{"sig":"MEYCIQCwXe22k0QXQfywaLKBqjFaP4cS1ApSnxHtv9dzDh0GdAIhANOfyPc5aTvxPClw/OKYVG63Nr857Kfj0toZwoHoaYpB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9e558ea7a0f0848aa40b1c43316c120f43863d10","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3226"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3226_1636161749190_0.9035277222879137","host":"s3://npm-registry-packages"}},"0.14.0-beta.3230":{"name":"piral-pwa","version":"0.14.0-beta.3230","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0-beta.3230","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"017a7eb6922a6f87a97644730d61ed26865f5957","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0-beta.3230.tgz","fileCount":40,"integrity":"sha512-gIKd6kHkrOeeCJdVMD5dRCqRKVjuBlGFkBh4/Crqx3lqMXW1mEBLVzgTuB5NaJGAodGHL1xcy0nORoCc0V6QUA==","signatures":[{"sig":"MEUCIA6Zm20pnMFqRlICKg3pTC1Zzoe38LCuEYx8Tm1xMBfzAiEA7aYDF0NdW68bIYJ2qBjzyCwn2UyMLIAFcqo9Q/tNyy0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ef69207205ff41122f0c536a111d0ca15048611b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.0-beta.3230"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0-beta.3230_1636377027483_0.2205391111338426","host":"s3://npm-registry-packages"}},"0.14.0":{"name":"piral-pwa","version":"0.14.0","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6b479e8d60cf12123fff6078e871c5de397dfd04","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.0.tgz","fileCount":40,"integrity":"sha512-oSIbNNom9iWB7+yGSX0/fiFsYoO+j9qzkNOHWeG/UzWMlP2hn0+g6We1x8N+ljARLuZiPY1wB4xrg3FeR6IkWw==","signatures":[{"sig":"MEUCIDALfy7iaBIl6oNMX2Q5NrZhEivQmI1Ln2W4NS/BAv2NAiEAxsNa8UGLCQlKSLmhCriX/n8u67D8grzN6n6hKMYvyi8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59975},"main":"lib/index.js","module":"esm/index.js","gitHead":"42d3691018d6fa49c2dd18a0b65e4f89961216b0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.0"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.0_1636394573199_0.533665989136733","host":"s3://npm-registry-packages"}},"0.14.1-beta.3240":{"name":"piral-pwa","version":"0.14.1-beta.3240","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.1-beta.3240","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"12aef2d7646e59fa6e42e08705ee3b9eb02177be","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.1-beta.3240.tgz","fileCount":40,"integrity":"sha512-Zcbea5QkGCaawHRhQfOfkGGGUNG6UEvN0yaWRfBARyLUb9V6a/5P7rCJkunpPC5FeTK7YEE3sTxySY62354gXQ==","signatures":[{"sig":"MEQCIFQ+2jDy++J5fd5r5oQpoHECmJBsygKAIJaP6djQtE0OAiB4kumRP350cjNkvbHq+eaof8tywXp641+kl9mVuLdDOg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d3a08ece776d0834721c52fcd7a71c769380bd7e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3240"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.1-beta.3240_1636511661290_0.975267012076706","host":"s3://npm-registry-packages"}},"0.14.1-beta.3244":{"name":"piral-pwa","version":"0.14.1-beta.3244","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.1-beta.3244","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"60a939b46b1f5d70e71b56d017ebe7b20d6691ac","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.1-beta.3244.tgz","fileCount":40,"integrity":"sha512-mXcw8UllR6cXqXwMBUwr1PMu5sTj0j44EtPcY0nAP41a2gRb/22PWOywedl2aWaqTzUGLIzhIz6IH23hyTsE7Q==","signatures":[{"sig":"MEYCIQDFyQWtcHECw743oZVl/jajf6oqLV5sQXVbcmydu2690QIhAOhp8SHWCOTkscViTHhfzn6cIpvR+lEfkDYsWHCNBYoY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"358d1d5a45743dac772d437b26a875b3d98c3008","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3244"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.1-beta.3244_1636545523248_0.8695238155917648","host":"s3://npm-registry-packages"}},"0.14.1-beta.3246":{"name":"piral-pwa","version":"0.14.1-beta.3246","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.1-beta.3246","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"03896bdcf552fabd693cb927031c7e5815440b0b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.1-beta.3246.tgz","fileCount":40,"integrity":"sha512-XlPiP0x0w81C6ohjLRZjdU1FI26M8lXMhWz5NPCYbb5x8Jbkk+5iaAjbPrSESHdUpBmENyxPWmoR2/4/VZTeMw==","signatures":[{"sig":"MEQCIENPunv7sc+YnqygO9UvjrtAXHbhD20X3IvDeJps/lJRAiAJlA1CMQlZxWbPCxotrbgfL3rPCuY364IfH8iVQN2zRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"66827dfddb356079be8538bc5e8da9f253f62ba1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3246"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.1-beta.3246_1636667113211_0.6950816163367854","host":"s3://npm-registry-packages"}},"0.14.1-beta.3250":{"name":"piral-pwa","version":"0.14.1-beta.3250","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.1-beta.3250","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"efb7d4592455706dbef8278ec113501d359e262e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.1-beta.3250.tgz","fileCount":40,"integrity":"sha512-+9yAxtaBJvk13ZYPwgoaQrUw14wih5yaOu17Ylna9f3k0PBaE+zBtz91L4L3bPLSYXUFF13hEUY332vIXDwtcA==","signatures":[{"sig":"MEUCIElrRu5UyTNn57nQb9TOGOPvC9ZvwmmPsm6s01kpmcfEAiEAtfKeabs21kPuHGY+ftIqOWXFp3WxtusIUzAAkY+RQsw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e6b329deaa798ea0b9287fbb57be8f39973eeac2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3250"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.1-beta.3250_1636730508914_0.9872140291681095","host":"s3://npm-registry-packages"}},"0.14.1-beta.3256":{"name":"piral-pwa","version":"0.14.1-beta.3256","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.1-beta.3256","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9c84dd748cde8f5cb001c0cd47b2e73993a9cf54","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.1-beta.3256.tgz","fileCount":40,"integrity":"sha512-Y4k3KY14mHGyUURHe8hFQfT91BkIFsLeKUr7hsAUst46dCgZiZOSV93o0vxMfTjUTCNUuEsZ/KHlGk3S53EAbQ==","signatures":[{"sig":"MEQCIFDiV6vkVxGmGoiUYwFyAu8hlMeaUuVl4GIxokAWoO2LAiAaVOVAETIRuNsQDMn0HDFb1sPUqiO7Pws8kDs16KDjog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk7lTCRA9TVsSAnZWagAAyOEP+QGi50NxKuvAWBMbior8\nC2k64agmMtP1XENDWDdLaQNFK9NitPWg+kb5FrgR55kJi1pWZ24DVzSLAsaB\nHHCGt2tABEV5CcQAu9QCouqm4UWp17L/gSIhDOArF36FPLc4wfAKTUOs1QSG\nDnNfr7Hv9php8piI7gLjbfzTkLBIVXm9YJ2SMeIQp/JURO/Ho16nEJY/FWId\nw4gaqz6mve7VexwqwWgQ1d6/eTebZddrgNlkBSolNDSBXnhIHOPZ8BCQ8o87\nqsOk3vCp2O2Du5E6w3aUgx/DhHr1e6McBbMmoj4lRIUwDIRcKKmHD/Ct3Yfg\nECHMekn78WRZfpP0gvIksLPTxlgIP+xQ3MMFDXA/3/fd2nElLHLCh+kqebm3\nEUk7poLZBDexvHmJiKt1ntIWuSlAHMhErnpZQodBMXJ6cZrXiC+2uBFbeklQ\ngOPj9UYsMRxBVzakILu1XLFWe6LyKeh0U1HPZT8PEVLIeUVSO/ZnaUTAc7Fr\nnK3gEkZ8TzqDGacQ1knsT7Wvhv1HpwSQGyjK8vQAanZUPC/AoTtYqRNOAaSW\nGjIyqdL2vZ4vjNf6ZbEMn0tI/vVWmzVtEwmTZyEHS993RCmrO/CYCiCBiu1C\n1g8b4BYJ3WX5hckMMvzKscQLeqyZaM6rKaMNNwjd5niuYNTq6FV7cio/DC7z\neZ2f\r\n=9Mxm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4fe700c9466e6c3920546713e911fef36c311b52","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3256"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.1-beta.3256_1637071187608_0.3330182788485745","host":"s3://npm-registry-packages"}},"0.14.1-beta.3266":{"name":"piral-pwa","version":"0.14.1-beta.3266","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.1-beta.3266","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"237750a1b885a77964ccb3280854e72196781b4a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.1-beta.3266.tgz","fileCount":40,"integrity":"sha512-CFXjXAhhM26+b+eBDan4zPgg5/XhESaHvTpDdDFMMAHQ3olgJ0elRw2zfw2UCkRaOuSrRZTmsIX5ektxHrF8FA==","signatures":[{"sig":"MEUCICKCxuM8akbb2Hi1jksZons4HPtujk5bLz6rzjfdT9+FAiEAnjnQ6nvmERnUH7InkwbbrrwifzqDag9mV+HLmP3o4X8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlmjYCRA9TVsSAnZWagAA35YQAIOymK9bvB6KiXahdTCf\ntYCSQzLwB1I4z1Rap2ej0ju0nCQoOzZRc7OzAnqT8Z/8fLRd03bwDL6oH9dX\nZ8NkPZWFiJbnuOJvhUNakMoW2TdUHQljPWoTtdqmyNZY3GBxzz8Qqa2JltbU\n0IuzEVoi4rJ6haKOMPLC30+kfl5BlVNjwdbCGWJGngeUtCwHoXbsumEkgwac\nAHO88gfeK1SHQ0iRQZuNqfbP+DywkA4LPo8pvglxWR0Wb/5tlYmt9m8fpgVI\npHYgIvoGPKtoihcF/QQ2wnChBmh34lVNJAse45JB/bdPLLfD5gNwXLMiybrl\nLN+ge9Z2G3aw5SJeE0qmFBTsKgcd3htnZ+2TWO6MzBQ3klVj8ImYI2uzQ2jR\nXAjxIu/9fPy/7r49sQCD1GLJN0oenqoT7fOR/3pj8Wwpzvg+9Txy4jpv8d0C\nDk1e/dVV4PdE1GAJ9X3AvA19ne88+a04yPTNhUUKe9tF3qk1tc8AbzEjZXbH\nRmSnkuwBXfTNBevneMy0dH/zF6J2i5phINZXoBAK7E/Y14hMIVMstVDedxTM\nPaxD+6Fku/h08jVRkS9CaOYgIoNYCkD+0Qv8Q3mFtmn4dFIIySDTNtW7llHL\nNsC8z5ettqvyHa53VNfzTt85NAXaq70sT9y+Q0uoNeOt60/0+Os07kvghRX7\n96E8\r\n=hig1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9c4d208eb5947e34cc929ce1613a8cb2dee0cea0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.1-beta.3266"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.1-beta.3266_1637247192335_0.13054210247927056","host":"s3://npm-registry-packages"}},"0.14.1":{"name":"piral-pwa","version":"0.14.1","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"690fa304e030441a3512f8e07f9ef66485e2c299","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.1.tgz","fileCount":40,"integrity":"sha512-eqXSprop93ulMaPexJ2wbAqPl1Qxw/BRVWSITvSpT7HoDfnujKGPdvfwnnwRkKNAL+FzlbrpjaUsDbii5iuEcg==","signatures":[{"sig":"MEQCIG1r7qTxBtknXCj+kXAC0MnzYanbUg0/pn9MbKEVQT6AAiAbqpetFsF00feachcr9TETyvm/BXRUwd6jou3mUJtqYQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl6V9CRA9TVsSAnZWagAAdFUP/3A57XLCOenYo0sloQh1\nMAVfpUdEzMuuKJt03QVcTpY6pjUs6tyu9PN2J+Re/Ny69V3wCrAy0BlubC8a\n+ShUC7AIIgiAhWb/Y1SqGsrnT22jo14WviMpm36nDMLeitpxMr7WlG7vGN1N\nvmkCZPvzgY+K426Z8zWxRUxAOV/51HKz3tkq9bdonsUKQPmtJTy7kWgR91p7\nBGx1CD7fpa/G33Czr8O0U4yKCVfG3FQZU1cqDYb/XPycP7XBqmLJA2nCGr3+\n7x2QAtdK9oJjcLFjL6FWKezi2qdTV07THkEbDvmD7JQ9Wg1cmk2d6zSNse3B\na0PT89PF1QKJvOg4z2kY59IabbCVlpefqHeBxrZKi0ynvTza1kFEYMsP2Dh9\nyLs/ifuLIpFpn9cSanndHi10pF4lFZIdytXOUx9GuTPNrNZhy0xGR7tXrPgs\nIVuvPxxrb789MrIwLhwyem/1lcd9Mrf/KWrVhSiPc+9TauFlMKUkYdVicUPh\naccFHreV67PnwyORU2x/qpYX2xXL5L5b+5fQDYzA3XmRRaEUaniq4RoCbeKg\nPdgXgpJkD3BvhFBkCOIjmEYN2GINMZe8SGZ1cayyN3vNQSqUgwyErD6RZdI9\nAuzVVKrOt+7LcviAd8TqOWDb+/XuQwKMLS0HkLzsF/MhpweAuIQ6QT4k6u/T\n62Ab\r\n=KjVD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"510c86441c19ffa3e8c862bfdcff73e93c730960","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.1"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.1_1637328253673_0.11231353165783653","host":"s3://npm-registry-packages"}},"0.14.2-beta.3272":{"name":"piral-pwa","version":"0.14.2-beta.3272","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.2-beta.3272","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ea4310129fcbb8635dbf28f4918f522bc776f1ca","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.2-beta.3272.tgz","fileCount":40,"integrity":"sha512-QnHqI/WxBQ3SQ73hlHe1vH1mvV9mDYH/BvBTkg7YNfTPmjLguuf+JAuZwvMhi+IOswSi+x6jxUSXnGVyq54zRA==","signatures":[{"sig":"MEUCIQCzi1F3dY3RMY2Xum9Ax86UsuQcIDwMXvary8ZeNALPkwIgfZrkQslZP2sRioZ2Dut4nidOcLortpBrlRejoKTZ+vQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmETxCRA9TVsSAnZWagAAMucP/Rta3TGKimdz1MoFO725\nPmLx7r+iMXXj/y6wkDwa+zqmPDNln9lvHnKykkL//JHElko9UFTXGGG1Ibmq\npJp2aDYOfw3ZnNNO9S4QN+1UtPLQvwO0DhD2wpqgLP9e0bq9oUoR054SJpWG\nIM9eOam8P3sd0LQk0zJjnNqTc52Vlk5NflwqLvfIi45YYoHz/GrI1SmbeK7j\nOL30xkGQIb9IJxrGxvAMQrbyA07vZ9mTtcyy/gXUdLgftqcHX6GMnOzQpdYi\n3pHb5DrKBjeN3aPw1np5ndxnpviAfJMloJboqpeYIxbOgnebVR5WfczgB0CB\nbNGTNs7jAjPXuy+VXQpkheE1kDJoWA9YhNPKUnoQu/JqytabwR+7AyOma5IA\n/ywD893wZX2Fmk7tUiSN9U4Ts1c8+/+a5puDo8cZnYs3UpMzw2LFhBPFgShe\nJdBdCSDzH2M4pckEw4qazCcVGTnFtzTZhYfQUec2dKSxEQWScmqFmWVitMpv\nuMXeuc15B+y21MyKYZDkQpXLEjKpEV4/G2/LAdjwCnP6tgEuHIkdnuU/0mz/\nhYvHgdKDoF4DL7PBfP5ynnizwqeTV2JQ4trBY/2JOs6BW9Hb7tK6q4EKriZb\n4bO99dpHSSgIWq6u9GH+Fr8rwrCXc1dxdv+w39fMfSyUbcb4yid30o33LRyj\nKyTP\r\n=eNe9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"06d1e9fa163aade40f9aa1f0233ef1266c5115dd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.2-beta.3272"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.2-beta.3272_1637369073427_0.1306213137885659","host":"s3://npm-registry-packages"}},"0.14.2":{"name":"piral-pwa","version":"0.14.2","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2c41bb8a9a195d8906262eb7d08c599c82d494fc","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.2.tgz","fileCount":40,"integrity":"sha512-nv+RZbp+fNy8RdXwSjO+N3PMpEYXXOMbzGY8MAHI5sedZIgjeDOkPGSGC5JhXQztRTtMq69RjirejL12a09cUg==","signatures":[{"sig":"MEQCIAb24/LrjmmKkOZJbaThIcT1JM8H51dSVpREDvp2rWUHAiAR8E1V/1UFnqc60UN0tVIiskQg5mb32PODbcPnmG1MdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm6aeCRA9TVsSAnZWagAAhVYP/1GYKvM8U2xuy1iW2btk\nSsB6bOb+rV8Mej00mSKwOyO21pZYlyi55MNilIqHM/D6bCb2Pb+9Jh/kFBv5\n5Apf9Qy9/LxeZC+NouIZ++/bmlYGSq9bnLFjf2ScAt+5HeKB34H5wnfxSf2/\nqSWWcPmYKV0lhwj0rIwZXjASr20gXzqLU6hLp/c0nxlsBWWTiQlroj0WVqCZ\n76TAuvuJQTSImhBM7NRp3/xGGN0eUpy0WbfE1meKh6UmEJbI/+jZLRi4un6T\nUcqI6ZoEPofj+Rx8DGotMIEUIVZXYXTJy4hLTVF2kM0j9SI8ZK2enTFsO+9r\nVDJ2Splyz2tVF+iEcnux6VtWoHI6HchkL6qRQVoll4WfuIsf2GexzKPZIyBm\nh74grrHOkhEzIcQkrAkHrhZiBaD9BcuSCOVaPsF0XQ1iGNTBlzwGjy1plU4y\nT+bJYLtv6ihDPH/18pRvmSvR0x9EIVaXEPV9kc+A9YS3WUvLcLqWaeyf8dsj\n1wD3yoxh5snZvkLg4c2hPDD2sphYzWdDE9aAW72D8sqD5Gk66aopyXzB4G/f\nldK3hNRNZ/oNKn5C2HiUIjNBbfpn4uPD/xznEKRTBN6RjOZKQjnpxrOUWMiM\n37Oa8d+xg18bWMZBBDBRUsi2KqJ7iMrcB9sfuqagmki0C3h78AX2YytThBKn\n8dyo\r\n=k72c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"eaaab0f56b872802a70d83de27a77911af37ed22","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.2"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.2_1637590686536_0.8787811930536924","host":"s3://npm-registry-packages"}},"0.14.3-beta.3295":{"name":"piral-pwa","version":"0.14.3-beta.3295","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.3-beta.3295","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c273fad15f04294122daa8ded15a4f7b476c9221","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.3-beta.3295.tgz","fileCount":40,"integrity":"sha512-qJDX7aLRoZrJ+QdtHXDJ23j3jA4VGoORdQxBiN3w7vnjoGgykWnvalFA5osMYEy5hs8YYceVGyI66v+a8fdK3A==","signatures":[{"sig":"MEUCIQDQgssiJn3pdmihkz+LkVzXcEHTNN4sOidjMK2SDTCF/AIgAdS3iJrcoO0q6weLB08XO7WAPQTvGEf8Gfm2MhcNqh0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhngtMCRA9TVsSAnZWagAA/70P/RUaPYjowbpbWfeRdPz2\ny73bjJjv+ePZhGYXG8oLYOVhG6+bAy8zUMTgYZcJFSxpysqp2vTAZW/mszKE\nX1176igLv0WaFy9xYPBEjQr+rfhU5hcOH0LNCbqomAFbEyNp20x51MlGUWjF\nV+oD7HcLRvzSPRJvdl37PnEMmzwQcFU5/ZX+QikNrpwflW6z5zjD5pBvYXv8\nbm57nCB2bjYVSYqAnTFMBHZhOmwT7EnY6Ly489DqxKNMKepQaeYl8ZTSmnox\nB3iNa64SHdiuhkvpV75G0vFYEfLZhFMVlf00QTeYiazh5K0p7ZfybEQsBCqL\naFiiQncvO22XSP/7NSeCKyA2U84dzsXK7vwmAKmzknNIQsclA62Y1kpx3fns\nqwz/Z8dMHEl0rroKiQXluv2bnsVZWANYh8uTDXF/4tgEAj0+pFGvCqaa8y8P\nKCrBjhoN41CoqCoVxWE8YVUvAUe/G9EhopWcR1g/wQjD4KuZepCd7C8FW/eQ\nvSwV3ajpSXNPjKqIy5cAmaNFl9KiV+O9PmPrd1zHrHJT1cpDNrvAHVtyawJ9\nECITX4LkRwZaZR+GwyJSLinT6YpBT3CwX6XsgLoE+1r0gDEp1kUyrYlOhX8Z\ng9A6/1efEQOsNK0IsBXxO2q5OnU1kE52VttKFuRerCdx4Ep/whFVZeD8VDt0\nCPIS\r\n=xUkB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"699a617d9f89c76c277feba775da285b99cf370c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3295"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.3-beta.3295_1637747532837_0.8144821980348569","host":"s3://npm-registry-packages"}},"0.14.3-beta.3296":{"name":"piral-pwa","version":"0.14.3-beta.3296","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.3-beta.3296","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"03ae67f50539f18208f39a26600953e85f533f05","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.3-beta.3296.tgz","fileCount":40,"integrity":"sha512-lmXHN9eMPE8LiHB4lNkSAA2JJRY/6KQoXUHwTyteWuAcLclTs15ekx1dj233yNTdMYoaBgsk503RE0Mp0I9D9A==","signatures":[{"sig":"MEQCIF86Q6szNKmRv8fi7Ps6wZw0RpMd1Tb3mIf4thRsDeMaAiAr3hKwSc25OVc+B3s9XuW8gJxUiAf3DOm4EQT0Wytskw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnk0VCRA9TVsSAnZWagAA/RMQAIU2DVe8Zm6MVFQ2/SJR\nLjzZw2ItTr0xKzrppFBTb9p9z2jfzki2e9RP0gKYZPu3ry8YTVOQ54PF9WQE\nwE1ETzoZlDxvbkEE0FJh7SngYR94HJkAep8pHOwZVuN8ihQwsXuJH11OH8tP\n7KSKVJLGqHeQd/UUXhvTDqoxwZSHJeb8v1ibcvfFhTNlg1sibuXuK2OQDSNT\naYNFjOWLumEgp8bhmVFcmJnwSEz+na1tiW4p758o052Q5Ekmu7m1i6CR1Yqd\npY3gZly9DMo8zm6QvJXPrizZnu3Dq6JD32xEBLsRst9f7tuDofRFBLe7ozQ+\naxApDMrZTxMLVuiD8WxKcNRmar6/w1jEUb6mGQm5zTAam3Uq/MgJ1fWIKt64\ns57MktiXOXWvJDPoHI9lUxtd3zyBiP6weGAfsoHfQ0YfFuOMtZYqFJcUECc1\nX2MfMYfN3LsCL2WnYQOrM+RRDsezoB9yO6FXcnSyWOVD3iAagSUoF+4ux/nS\ncuYOmPMQ0v3DxAbXqA7lSp3+7TIfS98qI7Mgho+buslWb/548L7yyFdjsdEr\neMCtPCK2ghC6E1+5NxVeZYD5/RayK84nRfytnAMTwSzY1mau/eudziJmAc/1\nLTYTPRT0Xurjb+mYHooDtlHguqKyi3UT1FRd7Ql87jbu3PaLmsglIf33nCj1\ncMu9\r\n=nPdg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b8a8c6e0f21e4572f308f64299d1e520b5b553b8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3296"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.3-beta.3296_1637764373536_0.020943647823999934","host":"s3://npm-registry-packages"}},"0.14.3-beta.3297":{"name":"piral-pwa","version":"0.14.3-beta.3297","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.3-beta.3297","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"831ab1e60ace62ef8e59edbf65ae8a479b642252","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.3-beta.3297.tgz","fileCount":40,"integrity":"sha512-IQkWuT+HmlyDw0L39F4eQ6Ni4qi+1hhsTwd98sGxjz5aCa4bgrqm09gbpi+MCItUex710zzDJKI92MWcUTSwZg==","signatures":[{"sig":"MEQCIFzGJaOnDmsMiD4ouRhDYRGBLuw16YEIDGxXD4dhO0gzAiAnFcRa5deV6kmZj50NjVfMutHdXqwFIsy/khBgvsyDNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnu6pCRA9TVsSAnZWagAAyooQAIz3ZOZVQkNUOdiPEN10\n9QtfSFHtVX8Xtjw0aZkssmRLGftI0Os/76KDdP3PaYCHVuwz//sSNjZYCO2S\n1y/Zfa6EVLjx1rlqAntFOEt3jRa6qd/dNpZA4V1yTkp/2XJlCKwmzm2Z8GBb\noaK+4iY58G+2/31QOOgOO8/xY3tJ2wqVFk1rp2+XGA5ALQtKblTPDRA7O0ck\n0X1Qh2VnjAFq0oHY+UbnkutrRbp3Wy2gDO3K9WcHlOqvgyPbi/CZ2pnltkrm\n5LXSWAgEnaGnjtdoREYnsQ+AJ25DYbywjNs0ffm1T5IHi+eGQOe/xp59Ggn5\nxNvsIhYyIGkH+cz5UEeEX3h+0GisbFNRR0RFZwyLSodl5DJrI/zfV6Ec858f\nV1vteN4MJ/9uQbwe2jkpA+EXuyfI6RNJO2u9Vx5OvKXnuN1yx9qFdVc0waXk\nUhKvZFVYum4fcOncU6Nz8qKZggyfif9ZrTBJPeuV4zEJzq0UakUvWb8TBp8G\n62O7u2bg9hPY/Jt1dwY+tLOOWpwSsUmYqb1AmMFGZ2TGj5gF7ky6IlYKLTH/\ncroP93Uth0JiIX0W/29PtZYpfqDr46aFQNqmE1SQA2TSzT9tjjeh6IAyxzKj\nXSeWDE9fVkDS8WWkbA6PZwgJMtezeZkoc+L1kj1+AkXlE8mjQbcpF2eoQVcB\nE2eL\r\n=Geed\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"42d5359bb0a4d0d9f3bf27e8acb205419bb4cc58","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3297"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.3-beta.3297_1637805737016_0.15105246937885086","host":"s3://npm-registry-packages"}},"0.14.3-beta.3299":{"name":"piral-pwa","version":"0.14.3-beta.3299","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.3-beta.3299","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7a52f0189681400f715617f73019826a2071b04c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.3-beta.3299.tgz","fileCount":40,"integrity":"sha512-+iGILVeQHTVMjEyzXMFIZEF60RCrhtM+i+0UO/sY9GRAcjGp2mSjc8hz8svApn3vHgU53EfHaSMeLwzd5FBvcA==","signatures":[{"sig":"MEUCIH7Gqlpd6xWlue3wjmJP806EejoeNc2k1oKb24GDuYvHAiEApsw8fwikep6DY3qQJ3pWQSEFJ7L7RI+Md+DTI5NgRF4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhn6VxCRA9TVsSAnZWagAAzGcP/RXg5DfsOq7IFfILRkjr\nay6uIXcT0JCb8ZShJTfFjYGMdI2PdGsYyhIAlL5T6P+vt+iOgQsUxTzeVcbF\nhbnMhEiEAqX+WsWuKeEtg4/GJid/NXkkuGQNfRkOJT+jdICGsKuvrehX86W2\nY+4JnJUz78aQhHzCSJ/VM6Fv1yhc/F9Eg7DDcbgq88ChqpLQYxV8h6Hj8zlL\nif+si70Y9qzJxE3Qk59tnG2k6waug4jibHD8cesaJwqHaqMxpGLnhaimO5YZ\nG31/RDD1hjjre70k4xECaRq9KI0d9s2k4O4eTbORblXlm3dNtoDojBJ235H6\nYNS4FsZyLixRidh9Lw3siWZ1Uwon8Iw8k/8sAY8194I9/afFVCGyuXeHeLjs\n6haO8awAm2mNIHPeupQ7qQYJPlYEN1Im7HEU3TiFCMaWHCra7CVT270m4sd5\nWrgJi0g3p3Sq73B9emnl906LCzqIQOhybWA/AJPs/irefpiPx+H/Z1bGM+y+\nqFzBziK6Ls51zlk6w+60Ca7/r4fDj2mJxqgRdFmCxWrVkdoqGNbMqsb4SRnQ\nrg6KEpBs6HLdAyR/b37buophHjeuaLMkCCEPVV2hGTQruoRi5z/SuEKcGYDf\nsnoA3yKyyc+l6o8iyxAYfUBiNX0qlFHcCfKUDS/agJqP2Yh+IOAORijEXM5j\nsqdZ\r\n=7M3z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2329c97cbca23e133c1b432ead68964f6ea411f3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3299"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.3-beta.3299_1637852529432_0.5530124533889369","host":"s3://npm-registry-packages"}},"0.14.3-beta.3303":{"name":"piral-pwa","version":"0.14.3-beta.3303","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.3-beta.3303","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d3c9293fc3fe67d6237d447d062d423772cc4654","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.3-beta.3303.tgz","fileCount":40,"integrity":"sha512-piDe5WlV6ANE3IMSMJA994yaMcJp/3M3BCWWeCUv7H4xcvsl9oLAyCLmX0bKADYYDV/V1RA0mWm6WJGVHYNNZg==","signatures":[{"sig":"MEUCIHbPHKccv6OqaHPntF8dYlGPomSgTbt33RIx5Rkz1GaMAiEA+QHJKll4qrJHyEhmUfHLr9Rj6m2zKuXGzBKjSsITk8k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoDdZCRA9TVsSAnZWagAADJwP/jYuiPH5gowU07UMkyKe\nJpLwI+D3UBrOGPSHBS6+9NtHLWhdnhyI99JfRKl2F9fG+dey0PfmKIQrTt1P\nDuqm0/uYJpGYeijQQ1PBTKZGeMQ0zuiXMY1wQjzjMWAazW9dFE4oncbayYt2\nmQLGjGokWahz3TkClgoH43j5K0agepv5sUzbP4oCLbt9bJ1q/02a8koW4S5p\nvbyMK1iWuMWv7yofe7g4kNrHWeOyLUFhd0pVPltbM59GJsQaFALy0X6WxSZ9\nOu9WlubV4bj4nlvrNTaMhDyuIhEB7aGrc9f1Y0fySJ+oAlf2Vw2RlWvlYxFA\n1/oyXQeULKrs339/Nv0odUhgEAQo4WCG4SvNckSba4ldjg4Xofw9L1MBCBQ6\nxxXJ52/q9yHTUpNk4mXGG+JihTA2ir2XrB/NXo7hSXn25Ep2VnlHnXH4IBtG\n0zFOcd7iCE8BuZmEVwQetExHN8b6nhZD3AAyaRMhG6pJRKzb9dEcZhJtwYE3\nBDNF8Z2CxhekvGXwvWijYe6R2/C0zlb7Z3agUii5jROb85jUQVofs6Lvtq4i\n+/3+1q91uVuQMUcdQBl5Kr3mpKhokKf4jcqg1oIak4Yhdji5P0oWjCRVevRZ\n2Mt6VT98VjRSD8btxwb9H+PWNh9TQ3MGDv0PWFTS3216wa2VCBY8Gv9DjADR\nwYn7\r\n=XCzr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"da89ec453fdcf613a0c68ff75d53d47a052ce356","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.3-beta.3303"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.3-beta.3303_1637889880930_0.49267391112178305","host":"s3://npm-registry-packages"}},"0.14.3":{"name":"piral-pwa","version":"0.14.3","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"def24e94189e89e31de72a7032390bfafc7ed734","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.3.tgz","fileCount":40,"integrity":"sha512-m07GavVxex3GdLJZHX96XxCp4tmzv0L5IQIcUTgDhXQuxy3LAw3Ty3cmZXcRasZxyPzHb+4P7ff8OzLEM9AE/Q==","signatures":[{"sig":"MEYCIQC5mWsKxIcox1sAmEXdGZ1xWhrkna5Q6pVGuEH3iGA4cAIhAO0UtpViRBQ/Pn8mbxfOpzYUcoLBKuHYBGuaoA4CYf8t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoLvHCRA9TVsSAnZWagAAMk8P/37lmP0MtSsJkiCGlyMW\n0mxYeaxZABE0HJuMC64anVE2qkQEPqcM58UNwKnkCj1ON4peIxrXT7Ew0XSM\n6z3yWZP1GmEU0Dpqo3GC0A92vLfSZ5/raBRkhdYaSFrvs5IpfSmC6w7x3Kpy\nLKDlwEHrS487GeaxTKE07Y2V+9WNBnJBo1BGhsibbIwjeTM4FLh6K5eKKLqC\nMl05FBABDUL3juaqOGN7BanW6YdGZnqFS7gFg2wvE49fW8W6QO7UAYV1bWBq\n34p5qgMC+hsR3zxb6HLNrOuPwXVyadQTVWCQljMKLSO+FzDd2DT3Fmck4iFJ\neLuzFus1/25+q4DpVlk9HqBLtEhN3RgTpw099bEu6s73cOvot/ak+A/bHWs1\nByik2dTKN5tcsb+YcIxELpLu2nDUvb4AYxRwUr2E3yxbTZSwFP9a6v/CEDa9\nMe0z0OYUM803OPmV5CtkryLNi1hzuR6mtuQ+yk7+URO0TVfI3yDk04LkzSb7\nCADtnctBg4JUkcJk0oOg03ASsomtLv4i0SX4q+Ozu4Mx7+9NxWej9PQYszZ3\nyioEz+vlUoMvvKQU20kZ/FHsJut0OkFBHY2NYuwheuPRpOMW5cC0yRD5Gl38\nD2wmjmog+FB3GZRs0Z+4qrOJHSsx0JPO385lKNt5nzeFVvuIBnRjYnpbKOYN\n1b/X\r\n=z5Ia\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"6.14.8","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.20.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.3"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.3_1637923783738_0.6034839209868565","host":"s3://npm-registry-packages"}},"0.14.4-beta.3311":{"name":"piral-pwa","version":"0.14.4-beta.3311","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.4-beta.3311","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3f74ce9f9f28e7916a5528b4f47d0895856ae7c0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.4-beta.3311.tgz","fileCount":40,"integrity":"sha512-WyIrOTMpYRyPunjw8lr0tLaS4VmToeRBfK7F18A4xIOtfE2BclpbTvrMryabHZ90F2nLVJC5+HIybV3UCj4KYA==","signatures":[{"sig":"MEQCIANF3Shtubi8K/Moogh9jvrY2uMQjUKnv542gYptzaNEAiBQYTQGXaWTYp/jAk8sqFIgfKQFY28yaZrhUcMOMNkmcQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJho6Y7CRA9TVsSAnZWagAArU0P/jCcRULsXMiB5Bl4HiYd\nArE8G6Rqh03av73YbflaugMCZMX0Ji0G7kCNmhH1vScdLnRGNBb2UvY4vqHM\n0OaQlqGMtZBbB7Wk4/t9cvBkayVq5MrqjmR3NUtVjfZXNq3HIKpvPshEKqeu\nUHwHyOOu8K0MdbtKYvCgD9X8CTI0BUQDcG6qzg9tBiA5kcqflkHIplO49SWo\nj6/n1GpHoJSx355q60gmxVVqtuQIiESdLDYI+ZHsdGOmJhegIYxaCuKFHDil\nTdZuIdEqnso6VVgdbH0Dwu/616MhQ2JGLkSr9p+0l12zEsyz/YAReNvzfZeG\nWJESnIzGtfxOwI7UyLygfH6EA/UA5yCvms/FWtNxQmWx6mZmHeA735cHfuCV\nANgaSMXn7GwiP75mc5OBtWIIX+Wu2h8WtogD1kmDXRFdp9D1SKyRexqV0akX\nxWeXgLZ0Fhs/6a3IAwm4MMkMTDU65LwvPzg/r9qCRX05uUr+5WI6Vw95aOTI\nU74NdcdwgfTE2rhkq4k0C4likBIvqaHoqmTWwSmR4mrSDWAWtmyXKE29msJk\nnIVk5O6RKYL2bBurE++kOf1qEeNI610f3s5hIwNPpnYuGDLsl3jN5zApJkpn\nLHTyDaFaBULdSWcLbm/qesBd15l92U5QTbPDZEd6xODSyjiQlGcDDjAlVmj4\n9ozA\r\n=IO1D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c2e4e413b6505da88b6296efa694b3b96c11f77b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.4-beta.3311"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.4-beta.3311_1638114875632_0.3920557109522984","host":"s3://npm-registry-packages"}},"0.14.4-beta.3313":{"name":"piral-pwa","version":"0.14.4-beta.3313","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.4-beta.3313","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b4e86239b5181fbb6dd17118ce7a155e0ba41e45","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.4-beta.3313.tgz","fileCount":40,"integrity":"sha512-jGNDSL1bwtRUs8hhuw/i4eXTGDc+s0qF7rHDvUOsbS600vmZuPb4KdzqkzKJdz4xCqGk+DBT5yJbV8Z2KRajbg==","signatures":[{"sig":"MEYCIQCdpwJhtHit/IJqgza1ouzN3+HwU09OdeXrc3a66imO5gIhAPGrh2SIKk1ufwICHemW1xr7GHfA6Qy4fipAhZ8G/M+A","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpQ2yCRA9TVsSAnZWagAA4okQAIkHFpFuku8Rkw+CibQg\n2+5KIGb5lWAclXFnNq/b6BwhkPaNtrsK72y9PQ3FO80jKUuMKgY8XRIKhhQi\nMkJRD9qT7dqqCcLR89tAptGl2HARZCTWMZYYQD72gsLIasPUy8sj7Rt6TUP6\ngU4WSP85xiU9ipQojgATit83FWTrg2gkr+GA+Qc1tXRYcQK3p4TlguoHjy8A\nB/ArBOBLqidUl/dJtfD+KPOtglz+5RcjQOi3Xzu2U2hsdbQ7744rPsf6nZ2k\nb47zvasL2gPzlxatbpJuhNnU2gDKSmnu8p3/gH+5FhYbr8jFA88E9Bfx1i4w\nLLMpGetjll26qN5gt6iSEMBTPRVd9PdxFRVwwUA/J1gEO71pIDpLmmExwEsI\nf11i/e7GGV4cK3qAEDYPb6EnXjYYO4YgBPgIPIRBRggVHf4wYLa6ssn+jorA\n8CZ/rGvDaUKab3VDA08vNJcEgSGP7w1hXz4SImeYDHYXpYthbWU5xbPlzZmY\n+2ZDW847B7IVLePDXAjOetgySBsdrrqe56sw3axNO+L70o2FLSqG2hk3D+7L\nQgrwCJLBzC/o6dRwSOmQFXRVYk9JKG8MJ7lA/e8sAy6qVXUC49WhCIIsTyOU\nb/NgpA5ddxyyPCYuZ/pL+KZiXhDWbXxtOy8Du+W+7UXu4b/YP0JCzA/1J6E7\ngzWF\r\n=YDNV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ab1a8f12eecbe2824fc7fe9b7a9acae33a91c0fd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.4-beta.3313"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.4-beta.3313_1638206898499_0.4975584094859218","host":"s3://npm-registry-packages"}},"0.14.4":{"name":"piral-pwa","version":"0.14.4","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"32d18ade06e49338d72e02822da403056a21c8d2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.4.tgz","fileCount":40,"integrity":"sha512-0fuS+B+SC5Q4ujp3k9MkjGH7UJ0agIbVHdM5cmkF4do6st/hQhTw3Aqns2vGa7EPzJmewB8Ccmkit7XUO7bu0w==","signatures":[{"sig":"MEUCIQCpXYjc4oHvyrxGFsAKqlf4V37cc+PF4NjOMXw7HfyOOwIgFev6Jn5u4v1w7ydpZM53z09VJwnNyuaEc3EZZ5wlLEw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp0O4CRA9TVsSAnZWagAA+FoP/3WZYpap4ZzyzqPug8Qb\nxdgh69BV2gOLnERdEbqC/92NLNS9WzK41k81vWg33W5W1Wxs1Amo2jJ19DUf\nuNSSBWsdk4azTjIVTZmJMIwDUaelXkfKEKy3Bt9MgVz0+hWgY23IwC2MhK8Y\nV44IpXtBtvOREsUp5LwzgPhes2vKKPvgp3U3KoAPlwwSLcWhcFsMECbSLxX8\nF1uXokFAWWo2R4KYgyHWa5DlofA7+reFENSMbt5y49PGkNDYAPx/T+XexJ7c\n4k4nXy/PnwnVfeoEw6UECg1cnAo48LCCp6dhMrMgZp+N26kGwp4ItmjCf7Vk\neuTztKZdqtJ3/UBJTWlJx1mMxpkO3cxTU9GNSApYQYd3Nuk40JjbwyuNo2bq\neinjXEgB1mzz3KY7d3/ueFuQuKA6hWNkjuh84XAwnIu/ra7lPx5lMzZO4ZSB\nDn5TOuPJlk4at7mxA+0OJOV2CWq8eNjp+G59+WBlZrIE91qqEekmWuDlNczL\nhhHUbXsYfaiYbGsRd5ammJkLbTgIElUqG+mrO+h4Tiwu4UdyyR3+BSnQandg\nbS2EHrG+uDiDdk14zbu4HidfWVQS4GCE//VTb/VpjtxqF8pG0Fm2m1G7qFtC\njRsqzJm7TA5oRdCtLYszSCd0jysKAhiUCzHOGO3/Z/aP3Hf3NSpbJzQTrkqa\n8oYj\r\n=agKU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"18c4b414ae4643486c44c057662fd5e4f04bf265","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.4"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.4_1638351800693_0.017855350294421646","host":"s3://npm-registry-packages"}},"0.14.5-beta.3331":{"name":"piral-pwa","version":"0.14.5-beta.3331","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.5-beta.3331","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"16855f6b63de24bb20081c9bc8efe5623449201f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.5-beta.3331.tgz","fileCount":40,"integrity":"sha512-s4hbnwizhDzB/rlvoT+f3HnGJM5eFxFINJtSlkEGAvP+uzDZ3g2B+BzwrXUCNAJ+V+6Lq5NDZXlrZnBNr46v3w==","signatures":[{"sig":"MEUCIHsqLNdJndHJN6GL1hmSrDfDR/Ck7G+3soa7/flrxYpNAiEAvrpHbNQD7pl071/TmIyhHG9gRy/M5MIANdscWfjj9JY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhr5WJCRA9TVsSAnZWagAA0NUP/ArRMSxtbXJoqUGBFyiD\n1hMUN6/k0nGpD24oYMWBEofBNMxD/FaUrApQL7UZgGljNW+Lm2ulCGKglu/y\ntN6q5loU4jmp1r+l0IFeRPLxBBE5akbyyPMLFa7na9tuaPb1xLVB8YufAqaF\nQudyvfCAtgbHG0BzsE/Ei7322o2re6Va87rPgpXF2ANWcVZML32ROCQG/T/e\nUpnXwhZtvxs5OdTbmXcA2s5pLarPjRyEMm92O2zDaPLaj4F+MQ5deInirMmv\nuVOUArnpZAdo64F1+diGhMu4XogtmpfKlxXe5QCtjVbFOP5uT/dh2caHMMh6\nFh6ZU9+gduG+aXiyZnAUAMNttCufID/5r5vxzNzPQF0LsMwXlvECVl1TvnNF\nvm/rk2+FqFtG3cRQDs6C5na13ASB0NIrx94w3B1jBHwQ/gPSCC8HsFDp8qt5\ndmkI6WNMP80MTF+12YEvc4PC0c2WFJj0y0e/ZibjT1Lz3RrARV9kfFauFcaY\nH97Ybfhwcoop7nWZBKRapM7jbzwY/7pcsq2el9O6OCVX7X3py2t4cLZckMBY\nO1LhCg1cxjxtlzTSDfkI5qQtlHntNXn6u5VNZPODO1sY7PS4BuNX2CYSC7GJ\nwQGpwdT1L7/nzn1xNOmBrr4F3tkRbY1yKYXayfly3/i5hxg5XJJyJWNH6WNa\nZIvI\r\n=NCMu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3db5015a2dbe8d68b87244b4d5ea6c9f84633189","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3331"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.5-beta.3331_1638897033313_0.019563484722204594","host":"s3://npm-registry-packages"}},"0.14.5-beta.3335":{"name":"piral-pwa","version":"0.14.5-beta.3335","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.5-beta.3335","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f2d36f97a6a16225d3048c4f9de3c08fce3a1e37","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.5-beta.3335.tgz","fileCount":40,"integrity":"sha512-TX7CQC5faBN154uqBuXTIB+br+jU/G9CiqzGcssioGOOLCD6595Ob+FkSFlSn4pm2M/RV9C9lWcwMCqJ/LO2CQ==","signatures":[{"sig":"MEYCIQDlrn31A7CpoNMfKoq5ftGBySxodjRsLX35+IaCNdzDDwIhAMETXrALM398IIz5Z8BpRXP/QqXGfz4AlNeSBfS/MqVu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhskOrCRA9TVsSAnZWagAAwJkP/iSI11OQxIn/CAhQ90Uj\n3VOtIPersEb+oXjD8YgZZbKlB/QKyAInHojXxWqtXuD7ZNBiOWWmQkdHbECE\nfc3SFmlTm6Mmbp7ItS/vajDYBLMxMhD/owAYUMklpUrVUQiGSqxi+8ghZHUg\nIc26x37HhcCIrXyWEn2DNZ7B/AznyeKWiyUv1KRfUJ29vCghi8eppOnaOrEN\nTKkJVtifrZljqrv0tMObIfk70F/NkJVMsELTTV7S8RKOP4y8j3LF2FEFa/Wu\nqwe533Zachjeg6ul5mnwxDE+FVeUuNkbrIhRnRO54jfUXAMFYUeSuXOFMuzY\n275bPzBcHCSuDiB4VKaE4FXYcfCV/8jvqZ6yuWoARYeE9HSbbx6sl7pX1JTv\nzi5353l3YYVfhrjZIcGT+O5zczGWRfZWyd28zaUO/QEmg/ZMQ+mdJwGS5wi9\n2YVRx86XKrnUdv2vpUgLQORFv/gUcVOrX7863brGq/HWPRMDIOFB/4b+bZB2\nrmCp5xthEoGig2U2zZ7hiJ4K8rHkfpyHnBJ7TRrHvIMxE3bp/4vPFmXt9jOZ\npDvzxWULT3j/JeUNM310n9GvYtGt0LkbBj4q9rtv3jcVgZcQVwlEUNbOF647\nNJSPg4F4qlHEIGwMh0ffX/fawI3rOYVDzf7KjkdmR7BFbsU1kqCYreTnkJwR\nO8hE\r\n=2Lvx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e4d630fc1e08cd0b994791870e26fefe9e1a4d86","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3335"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.5-beta.3335_1639072683883_0.07197964704418491","host":"s3://npm-registry-packages"}},"0.14.5-beta.3336":{"name":"piral-pwa","version":"0.14.5-beta.3336","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.5-beta.3336","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"55f32da7c637a9627e05d30b33b3b2d22d9d52cc","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.5-beta.3336.tgz","fileCount":40,"integrity":"sha512-HFbBHh7VCSHmIfISXDQnbxSMbQlwuG/G1kWX1jxpUwB2+xDmyD/HGD0DJLfl1XDAjy5+seyVPcxBrbgU6+h5pA==","signatures":[{"sig":"MEUCIQCycaJfkLI0IrbzSl0TLn/+6JTtZoV6lvf5zar9SVWVLwIgDvBz7ncbv4rXLyDfrKvo6p0BWot8CoYah73FvIUDgaY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsoRdCRA9TVsSAnZWagAAK1YP/iYAnmAiakLA47bpPBrg\nd/3wVaopHWJ1r5tfm6AY/Gf9Lz63C7+FsrgTxC5CoH88NOAm2KoolIVcUHLE\nhpXjVcF4/WHiV9tCvSL+ksQKflBIR5mr+kwu32Y0m+MWr9GJ2PI5e82V6e6y\nPo/FKCeNwnxHyK0D4Q4DoEvSKu8ikpaIeTtB89WiOJEjwx6pDhwli7r5Sgp6\nUXrcxj70nP4OPK6+hY/mnmz6Rhg8xzX4bEI5SdJCxgPOZGpXRTuzwvD2VULZ\ngmFEmt/c9hXFzUCmxZuanpJD20rSsjM0FnU1c6eYshRBCvrScPD1jXTVu6oY\nIIhpF1gnEPujjmIaH2yhi1n4jgW+mimcfs2Gan3bC+bmETYoQ3QySiz9o2eT\nCxeACm9aJGAKy5gTZRY76+hz1IcuvV+icaMwZcJRRptN/T2PiYch0GGDo3dl\ngWqQGIhj6BIrzP2TLm0MsymdTXZ/5w14x6QFGtpLZmfM86EaZNFs7u5uaWoO\njJhPGI9yzkdAdg8zF98Beg+uyK3uaYOmPlhyfWUMSuN2rKy9T2gK64uyIS4o\nofUA/nrDX1oCqMrb4IOub1aJstSOVRtfIG3uGzYj36NbCnhmsEo5NX6jFOR9\nNUbKDFXNUI3qF4s7EY/7MuMGhMHd7Z8O2Reg0Z1MLEcCBzFXlvsAdVKFZkal\nilNv\r\n=SFFm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"db950799d09a66f20f356adc35d3d6907630986e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3336"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.5-beta.3336_1639089244993_0.7143333956951561","host":"s3://npm-registry-packages"}},"0.14.5-beta.3339":{"name":"piral-pwa","version":"0.14.5-beta.3339","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.5-beta.3339","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f7a0319bd83269bae13e2748cb242119e1c45e5d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.5-beta.3339.tgz","fileCount":40,"integrity":"sha512-Kndb+zvrpiykDDmFs8Ei5ehwjRtFx5t/DsHH5Jw/CMuenpLuTYSrlvUqif+7oOYX05zZBruXuGusmF6b/dd4Ow==","signatures":[{"sig":"MEUCIEgI+r/5mimFPhx5NEmzuiLokJ24QXw7ZSwgOrgscXpvAiEA6Hnd/Ute/atFBOcMKKczFuLj4lv/mbHF8ANtaRlcVJY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs4W3CRA9TVsSAnZWagAAolgQAKSLGPNCot9h7SZChC92\nY3sQgU/xkQqiNkk2alFAtl1qHK09YMsWQoEBkSIvBZLfD2cU/qK35EFQ2vZ1\n1hxtEcj+TeUX/5DhK2cL+s6hpjzhU7CScqPKzHsiG4s2xE0pYEmaoVI3hYsZ\nCSEP8yNAZuqsX4fq0h/0eH9QFwmUbxMZ+y5029NRjUfALzoUBs/XzO2Hu2HQ\n8SqtnBd8jAQX3WpFPqd+xNYaEBrv/kL2bJwCKC6v1qLyr21FVNT0BgXRjdk7\niwGlTnb0Gj3Ic+KxgNialxJZIUOjYaPSgmhD1gRCmuZVRNi1KT2j5fNxgXbG\nz7P+hNSPjxlg89DpbUByH0N5n3pkcUoOJaNMtjQ2ZJlFsIUmLNPoaA/+fkis\nQlLlz1jv09+EFkHqbvbIwYFsw7MxvxzArAT6TxWWfU1sHU9MY3gLC1C0qD9u\n+MQa5DlWZCRzdbYUynL2uFDqDKjIzgpczYe9gsGpL+ccU6zx2PCGuGsfW21T\naC8R8WgDZ4zKdZMeOsJR42Qubjd2o0Mxj7MkjwkLAjGu9lePFiOdML6W4IHi\nFoAr6g4mamdz2bogjQTHQN2ieE++OTdmj7rtUb2gp1j+3/ZMp0ZRF0cc5rTA\n2P0Vhh7GKNC4bPWH7rjvpw0OwNMn3P/oL2LmwgukS4geOp4TNJNUBKmp39CN\nBw/D\r\n=9yr5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8283906480a53afa293d4c7f23c2ac83227ee542","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3339"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.5-beta.3339_1639155126996_0.5905180216461277","host":"s3://npm-registry-packages"}},"0.14.5-beta.3344":{"name":"piral-pwa","version":"0.14.5-beta.3344","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.5-beta.3344","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3afa8bc836a147e39542dff7ee6af4995f2fca10","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.5-beta.3344.tgz","fileCount":40,"integrity":"sha512-eKGskl+9A4U3iC4DKpk7HIQtLC8ylrHaKDjDruqFkPB2prjsauUZ9+SZwpyv/oqmdkadaEJd8lvCq64fb7IasQ==","signatures":[{"sig":"MEQCIDWTQIon+jj22GxGL9gRASIwF4un1VEOR7wG3Z4lF6jSAiAbip+k1VjEcwdQr8SmRwi9J8ZdgcZ2E40XAMBkt+aP6Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhtRopCRA9TVsSAnZWagAA9mMP/jgstSiXqjPZNnPhfVaS\n+lWPg5Mgex9o2v9JRptgunaJN4xWuwy7xU4EfAvwA6OesTwDrVIH5bayC7Id\nixoFPwSRkyTAAwjHRnx+UgQ5DTmJOgIEcacxMYixNZtVaCXi10GXGHm8Ka7R\n6S1oRxR5Y/a+80M6dcj6vYBNkzAMoalqJy7AGMdrw2ljBYNrRlYO1mNdXKx6\nLBoSbYAH37oDRZps7UIIpa3dJ/l1j4mrRlpLEQENAT8auTvZNvfy0WfzeCJA\nRwPgdTN+c/Q3CHZoMOqwXPK/h9H6DN4c2UXvz1uQU1M+qGaVZ3OI53od9Fem\ndQ2Nzvb3RP2I009vVN2QEXor5FKb4pFkvV/xZ3/cuPsKhWLuffUUys/BcQXw\nodpzv0wy760h3LpAv5Bhf3pThZ1kBRJif/JWMKEU+lhSvRSbGtxRMwZhY3Ja\nxbIAppQ37s+3bFoptPlvR8DdXEvrbzvPy4PcpbtOD0dP0ynz3TPNVqkVu2oQ\n5iahEQ+7RO/oxta66l4P+3X0VOSW0751DNeLFp/4bDthU2MzhDVgnnZLuwts\nc5ihZaF7JKNkiopiVbEtT34WT3yOBR0fVf+CNkRDLOOCYCXPbsstqJg5sI88\nqxgg9xBuc0OWy7JHQbE/GdprnC4i63PpJEVEutZpkoOV0CwbzSYir2hh5YuI\nsxtX\r\n=RKn6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b462c344e9ea09919e3f9b9f3da058b773cd5814","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3344"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.5-beta.3344_1639258665231_0.19926749628805673","host":"s3://npm-registry-packages"}},"0.14.5-beta.3346":{"name":"piral-pwa","version":"0.14.5-beta.3346","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.5-beta.3346","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"03da9fdc503fdf48c6c714a9b45cc47080561153","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.5-beta.3346.tgz","fileCount":40,"integrity":"sha512-z1S7JIsTnz9I/1CYtIH1O1XKPbCDGE3PMH6FVI5BGPTn2vjZ2mjdPi/INOgejWCH5sEaLwrCUWETVyp9OnUkuA==","signatures":[{"sig":"MEUCIF0ivQi3B9D9r+vUoqXGQ7phkociXJ+cbjnHYsiuid0mAiEAzdJ5Y47CjlzqZv1l97b8NRGdFkz+t7Q4CsLC5aRV6+0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht0ruCRA9TVsSAnZWagAAESIQAI6A8c40wSCgPCsqUfcY\n+3odjnY41woXayGHoOnTt50XskU+hE4JA1vuIHssbI7SCYst5AnPSQVxM6Gn\nsmhr/GnObiW/VYwJ61+yapMxSPrHysDraKYDan1Uftz52ufQbf0yiqAp78EQ\nO9KQwNR7vgVSwKgm7aotkPE+YpESQnzUaxRfeLVO3Luk5gcTpTJaiD9VD/og\nv6KRBaxu40U2XEgN02eRh2WMeR6jwne5nhnt4RjlnE/vvJs5yBT76xIOkjoE\n2gCQ0FhVKK1walvr95RRhHc2bfhNUlQZ6pLFtSuOFjRhBbGevew8+9BlmrX9\n/mlNo9bTPDapKce4fE3tdgqgrq2GRGyCNwFqszMnVmwob/XnbbktpU7LWGub\n3Fny1YuNTp53OdduTSZOwVAG3dRnfK7jaA0peQvaS3d18PZh9K8/FJtoN+Wa\nc3WEGRUYBmWO2IxYzNAF0nd6JXac+TZdGXyT6/uKaxDVTnDHaKRqS8X17Gs7\n18s+h3QfUTX/1O5TVZ6rb5/PPAPtYCWI6ULzzNrcx2ocDuoLv3YjhFIm/FrT\nGID3E834LgDSGYeYdvpo6JZgd/Mqj4EHbnHjNYDXIzw3C2wuLsHoElmjHk8Z\nodNOaVCSCKyW9mf5e/fvCDP0FARgqE7IVXTQfxdijX0rVWbgCvF5yvor3NkV\naaVq\r\n=g+Hp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"97607d2b43b9613d0c0c92ed4ce23362710134bd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3346"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.5-beta.3346_1639402222728_0.06943417967473509","host":"s3://npm-registry-packages"}},"0.14.5-beta.3347":{"name":"piral-pwa","version":"0.14.5-beta.3347","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.5-beta.3347","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c8e02c9548b8c42238b927e0b8d7efd86309088e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.5-beta.3347.tgz","fileCount":40,"integrity":"sha512-p8iLeYwjcU0k4d5y2y5bbpWyKdKQRNY3xCDzg3NUJy3Iq+yvzcZoGOPse8CSU1YXTcxIqVfokPEXOL8qAP/Dlw==","signatures":[{"sig":"MEYCIQCz/7DPsXeneRp1UPQqQeZkbIKfVe6xN6Zewh/bhUQijgIhAPPUB450eBgjEXYq3psXAw/urBt1wQkMhU7Kh+YXRA+X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht12TCRA9TVsSAnZWagAAuE4P/RNG9Hub//DJWpBOMLwT\nNQuNU6ncUmogKvhXwtiIOCutjl0z/TXepwLSXwd7WvRrQBGxhFD54iqaeFgs\nkBl5j/t+0JkuAcBTR3Fw0XzvZjcKkW8EEnD25kjqYcJN7yixkSaXO6RYNbku\n6IqKMQjTshACp/0HhYb6isgJpgBsPnP7ssaL7RydbSRUV8V8pjUiPCB+y7Zm\nUYSOKRB8UZMTlQ+vlQ9eMTbRf7t2rbPY7zMZQkJ9kCobknM/n3zE5vi6CDCQ\n5cYeXAAuswbsRXhhIEl7eOPqz3OpWWsemCo5P5/KC5Wa2cgH2MRI4Kk+a8Hy\nr0oralOVyupbJSSqlIzZRROvQGG6Sdboky/aR4zUrjXQEA6X4sCiVs49fXHS\nzmSE3aab5c67RlSgjH/4kjGmShCzEMz0ejyLNPCdjoxXUPpTFNfb0H/Wgpob\nfGGi7jGTMkVB7T4IDI5NFAeSgWfXJgPmmnlDhcqipqsTsk6BZLG/rR05XEef\n/hKuIe+dmxibM8wKgnJGDNiaeDS2YehBI+1rhTJ2ppQa7/D6bqi6x6iOoLfi\ng7zs1sYT5ixsDqPflqNYDjdx2ZMEBpojfpk2qHKwUxZODUanNQXl7YEhIde8\npZIDnX3Y8YDYom3o9Xu1/cbi1X9hDvrCZ8NZymUVXQ0OSBnOnJjpAK025GR3\nbyaA\r\n=a0DM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b0f46ae0f72d5da0fbf834d5c5f553cc70aaa648","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.5-beta.3347"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.5-beta.3347_1639406995445_0.9119199739050199","host":"s3://npm-registry-packages"}},"0.14.5":{"name":"piral-pwa","version":"0.14.5","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"af7d6b3a814c71024f02997dd9685345779d5eec","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.5.tgz","fileCount":40,"integrity":"sha512-UuJUWZwWNyGyZNw8QU9J2IsdSL5tOLtsAuSuR5h2pFeGdpZ0Wyi7EzJbE0t90JXMBmGDLTjZGw6SLwKJLFhlvQ==","signatures":[{"sig":"MEUCIQCZ0zeawk7DnPYYTDDA9jEA4wSehH300AZxApDQlXWcZgIgLThO/YjISdOLw56kT+WT/BrUHrLMSqCFbKOxtHZC4UY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht3cuCRA9TVsSAnZWagAAqWIQAJ/8a4kykgfPUXTZcWuD\nFggtIC6OPow8Xg69pP7WqSvqJedEj3tW+q62cYs1GEFNzF1lSLDJto0UiKEq\npwI29X2qSK1AmuVvaJ3hQeMWIJUk/gxjLlG12H9W6zBk4Uemhq21KjfXIbno\nqx7A233q7GmM3KLVq5SUlqga/SKTlTCQOOOQdINx/Y4e4/XoyaY1WQhyYIN5\nsfIK6GjuYIqznzRQ47PrmuHKioaPGtIZurwt/YeEDtzbCYbubbv2b0b/R6eX\ngHZ4NylsU1rcIz01xddv4R10tL5jHYlyVSBNV483CY+pyV9m19lKmNyyqYru\nbv11BuVEMzFkycOAThKiwY32MqZsWQtithX1GAQZT4sQTArXi5xQdhH0d1u6\nhLpeQ33TihKUgAmR23uczNABM+shI/icsdfIra3dRY8UDWUqcHzrxYCDONxY\nbW84PEgPQUOrXyp31JdsYYetJdVA1ER1U/pY/9CFWfSJYbgx7wjzr8ftVU/z\n3vNdtlzdql9wo5mF13cqLzWVyEghVSEY3wzi5vhzqaCUV2hmb2pP7YK8GTaw\nR0mRP2ljmW3zLmiAYG8OJiBtspXPSo+y5EFIvMjFTdo2GR1j9osoUKRRNIbv\nYMsjvl5Ix7panPYyzgLs195zGqlXDFXxNh98C3awVJGYwb5WC9vkH5c+PtX5\nw2gl\r\n=kZSe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"d2c53e25895f855fb7be6f7a09afe6ebe8b599e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.5"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.5_1639413550230_0.9210409045625609","host":"s3://npm-registry-packages"}},"0.14.6-beta.3361":{"name":"piral-pwa","version":"0.14.6-beta.3361","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.6-beta.3361","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5efc4f0c5f4586408aac88a7310371b546825c8f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.6-beta.3361.tgz","fileCount":40,"integrity":"sha512-CLclwqutjrE9MDtL9YMRaqzo5uBHdHr9kz5NJpJc3Mstrcix5xiMJnxwvjBde0v5APTkseaiBakHmH4hri4bRg==","signatures":[{"sig":"MEUCIBHJeVEFPzTPq74xkj03wESgQo+GF57/1scmXoBMVuXTAiEAxjx3/ism6ycRiwM9zxSO3TE9C6J7jI5DKAINIsTFoPs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuh1GCRA9TVsSAnZWagAAESQP/1qnoi0YQcMyDffUYij4\nPQvi/tXQ70F+coZ1qhoKGKTT9dLJaZQ7R+VWg3CLbDZaIlErmpAK440pdYkY\noADyY5sVh9Otww+/cJnhVoVq1xdc4FxpduJGv0XFP4gpc4Jq8euXxDUCI8bZ\n6eX3zzXz4gXNn6B0v1cJTl4dDp7cwrXAYKvQ7WFZ8zafILs65NQFW81gb7lF\n75R8vdBH6cGswJ71oaqmLmIYBfs5lMJpEh9iCcwueqIzkz7gjHNiEcrUIjRm\nuUBnO+Q57+RVnqlvw7K0pPa9EhZMV6oCtCh84fUKp1nLIByGnZlvPV7D9j3o\nd1NTBKqpyDlNMLpraTJU66TL5S/lsQTebd3BnBxVs9WKhpwTvTElidtMVDTE\n4bUCsBeWFUiif3x9u/9UWnbxVL+I3JAOEiHrTJmJ1hwEbQfqclhZveNPR2oy\nZB3h1VzmWzmL8n27JRAdEezGhPAmHM8dMabGQOAeXOdMJjc52Vf3bDPfCBY1\nlVhEL/AfFmoACpICKluu2BiYgL94T4d1Kh+PLAJYbPCAs5ndMoZ7M92lXnxn\nbI47GN7MQ+QXMQAKF1QPwPpTCx/K8F63sDx1cd7drYiwci7pSu7g8hsgfBY8\nVoA47g5amm67+qYv17mbmx7Z/fRpHXmF2g7JcYSs59/r7E1HzznOIso/vW2i\nqdHH\r\n=+j3P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"de8dd4b06e6115257363f763e9d24fedf740fdc6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3361"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.6-beta.3361_1639587142205_0.9431020281202092","host":"s3://npm-registry-packages"}},"0.14.6-beta.3368":{"name":"piral-pwa","version":"0.14.6-beta.3368","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.6-beta.3368","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"474cd1d4ea569ae2a4bdd307255a655b6c106577","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.6-beta.3368.tgz","fileCount":40,"integrity":"sha512-9BXW/WhUvOkhCTxSJluVDoUQ/3AF4JDiMm1H/iTbQcwALMGoKYcdy1NyiC829/XzA/Ee2dn9cWia4PUZ1A+uIA==","signatures":[{"sig":"MEYCIQDJS+xKch58DmjA/TUfWzI2h3gTLrbkJh1929nIAtRKnAIhANHtmdmMfzPy5NaZy0342vrs8+a4l1u+jFhnci2aNRJG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuz3dCRA9TVsSAnZWagAA5NwP/jRbCHmS5NZ0q19tB+Mh\nicHwmu626OC+J4xy3jbWz5KwqScXPI1Htgval5wjTfW+ECpMljmB+CQ+4y+c\npKj5h+boo6YEViTAlAdsUticR2CKqYew0sXCehp7xRxsESDn5Kr0Ka1q2O72\nsP4hA8HUeDJlH6qL9HjKwpwj3YE7dQvq5kpgvEaAnkB5nIhl8pWINrNyHwrj\n0Ir1hXFuXG8kUp8NKw5HGYqcdW3S10WcCStRuVODSZ0NK+tPR/+8+nak9+7J\naWaEjvI31IDWKG1U4/7F/YmQmDN7KUnCkgjjay4+pdnXWfooOfHNZu5L9DXt\nGgai2cSwv+mzD2fdY0L4BsoqRxpCwua7MQVdBuxezWjwd43Qop7nZK5pW5lX\nEpm0IJFEvVhOEd9gbi04EZEQZ6IviAPUD2MZigHWKukMZUQZrri2WRUiHKQB\ntVTjNdwHV8Tl+FtNMWJtatu4VGS2cvfBRwQPFx++zLN1zcB6MfJOWPIwsU/2\nx7JbsVvbDvZlzBBWKkrGgTdnsfwvsazNFDmJpWBVTb17XoCNU2oTBpLM9vuD\nXaVxf1WZsnVcCXbbwWKAOjm5IY9SMW7PSsDSPE+gxPCUc5AaA6SJ4+RkXpxQ\nqnBGZnvEuFj/iqBpXr4Ys56NqnmVpj7XA8Adz/45XO+S0zkaH2YFOZOLaZ27\n7Vre\r\n=6w2z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f2fcfcba5ba7ce9ac91cc97f9a4371422bb5bf36","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3368"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.6-beta.3368_1639661021447_0.9179740818055817","host":"s3://npm-registry-packages"}},"0.14.6-beta.3400":{"name":"piral-pwa","version":"0.14.6-beta.3400","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.6-beta.3400","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3e93cabc475dde783cab0ada5055c32d9cdc7afd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.6-beta.3400.tgz","fileCount":40,"integrity":"sha512-6moSwaq+paP6wC4GYe9OAAjuxhQUC4w6PNA3aoMFTOfgZoBSkPhsy1K8e5SiuwA1w/IwtEAgmBEJeabkikJClw==","signatures":[{"sig":"MEUCIEnyl6cKzvUrwDLTcO3O5E7/BSgU2hKO9lYpUhHjRi9MAiEA4wj37jm7crn6leJW9nvFSpc+Rjvrtl4FyxdlKQ0Mk/Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhw7p3CRA9TVsSAnZWagAAONsQAJ9RVP2w6p6wDg4fl4fT\no2iVbDE9eq84GDSCf+zMfiu85akjsWcsP9YzfYZHN7GXuR+uvJcwPVpO+HPZ\n675Em2huUk7rMNHXe5Nf29SDhAcM6fWRt3Tf8/+tmKeOo5Q6Kwhs7+7wM+aO\nOGBUavLH3oKBLxgtwlFwxTkdWIbQI+TQ+KdUl+fOSV3GsUbiBbyvWQdO1Bli\n+EuqBfyM8RLu3fdCp7260qx8EC1UNbu/Jfw2bz2vRm3ZB8Na8/iZtjI8/PRe\nSHnWKhmtR5x6wKA70m0IHFv+hl5WKA8t090En8tgk4/WCkYf0ontHouuue3O\neWmcfky2AeD6FDBX0cOt40ilOBROlPumm199g6J0S870Tr6hGnxg3HTxvF4d\nnkTKTt4B8vfcqBk880di8RtTmnRnbMJGn2EIdCOJh0fy86uNs0eQXEhNU1oI\nrdmPK2E1OgVtOX329KpewClM+uCRtEya0b4pSclPz7BV2iwDbvv2lZ9qiKLF\n+Ne1O7Ht1NWV7e2c3JdH6u2EDQaYHjMRcuTfNcTziLYt9Zq6Rf5SpgMb9Xv1\neJOkywuuPCO0EBl3kp3BBzDLSLFIDBc7y+sJwCHmo49H4GFTSK0rfeYH8WNy\n4iN+Dts85dKpODYgOcZeIACg7S0RAQ/SGy3MU/soke7VSRypYEDz/IBmVW5V\nMzgf\r\n=uTWe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e579432f5571034e48696c185d354b5a53a12b9b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3400"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.6-beta.3400_1640217206965_0.8880274478763268","host":"s3://npm-registry-packages"}},"0.14.6-beta.3419":{"name":"piral-pwa","version":"0.14.6-beta.3419","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.6-beta.3419","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f2d39aec43044347f99617accd7c4dc4370d6139","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.6-beta.3419.tgz","fileCount":40,"integrity":"sha512-kGrD2P+wuFc0vYu/pcBbojBlafsqPgLsxkT4hsFln2A7nH38CNKe86CB0yALuqg1EvN9zIrDi0U8Utpke6YgEQ==","signatures":[{"sig":"MEUCIQDns5Z4PaTXQwuKgz3b5SKJPEpGg4L31OsHHL9Tw2q0dgIgc9q3UU3CJ/SiUWIPyojzb/8fYMkiN58AQ1ypvZTcbjI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzyI7CRA9TVsSAnZWagAA2lAP/0wktlSQYwICz+5Zf06M\nQy2Pvffx5JNJdyx/PZB6vp0sj7607sF0CY0jFvox+01Kbo6XvNDnheMmXZ2k\nrvp5bUZ13rVgEnw39O9j0uLIiqv51T8zK9XroTX2klod+nDMIl8/rMzf7CDW\nSoKzah5oPScSfmorb2zZJXhq1LyZuJQtpkt73xQGpcwcUIwDOKScn8YjjzPk\n4nLdMWMp8T+N4D6fXw7eIzC6zsSzKfkvxtRiXmGXsIXPcJ6WQmk3ZAaSLROj\ndpNe/GHChMiSA24tpwhE105I/V6qgvJrmb6KmC3g8kSf0gdaxnQ6kKeMjsRB\nQQs8bJNmw3nf0pbxcqpT+sDB/duODpZWDQr38RYDmaz3TgRP0WzRyc+K+KPm\nrpQfcwUtipHJ4M9u2QqvB911vTeW2iU5X1i68pDLaemGkz2P00MnBxjV5HjS\noI7PWmDxLsgu4KIp1KpjuN0Fr04Z+1RXt2P9aCdF9YtKihHmoHRIwNJjKZN2\nD8HvYCjeU158mucX1JZAGGC0ycD3zxkQRpxXplUlMhzeKrCi7cJpVHnlqpEr\nDWl/DSJzART2t9wng6t7UoaklPmzArJQCcIypFTJfXAzb4nPHj81knmv+bh5\nUHtXFUXEjnPgeMrL+8NaYU5fwl5yAwsp6haKWnzHJVptiMPc8TNvVlY1n+03\n9nEA\r\n=WYkF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7c83ddb2a2b193991fa16153c92b84356d8a30f4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3419"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.6-beta.3419_1640964667220_0.34866344771291335","host":"s3://npm-registry-packages"}},"0.14.6-beta.3425":{"name":"piral-pwa","version":"0.14.6-beta.3425","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.6-beta.3425","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1da11f2af264a6b493e939be8e7312195b3624a7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.6-beta.3425.tgz","fileCount":40,"integrity":"sha512-iYEf5p6Z/GXnHIr9NEqJCAcLr99ib+ba9LrHo4ByGCUk/6gBtzp0H4j++w1YCVyWQID9mElhLKddsIXbkAge3A==","signatures":[{"sig":"MEUCIQDACeXW6Y5jpzdDCl3+zgJ9pHSvLL+JXwOF46r8Q3ZSbwIgdO9q6JKz+p/aK07UGVAKWo63s7Kdf8qfhr+Bvr5+WbI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1WaeCRA9TVsSAnZWagAAYF8P/05WisiAGXxOEdrKDdfk\nmI9k83Eszw+54pEJig6l1KF8zUtxzaIwk2ICog6PNtLNaNubbJ+hXOT6BhqG\noWmkMNTDwSiocxnW9nhqjeOzhyxkKwNanlQN5pLwMu45lZre7ghYOVrdgWRQ\nYGlHkDZ/IWd7bP93ePverakiIraPSEv1uq0VQ/Y300jb6bA2HG6piZ5fRt68\nX5X4cxaNIsOTOhB8BthIhaCqKPuqLnicrxAhUhUrtkLQU04znB2jNDbDH5Fm\nZWPNSfCHmX0uF1L7auYYxl4l0YHNzTZwqQyi1PL7FAhvgpOYR/YP1w4Er2s4\n9+hQfOlVjOzbjBTxLzrKvcOWsby1RpW8HhBk43oPGRJR62aWL+2jyPlGd6Ix\nyHOB1YHW0G9WIylcV2hZF6FEvwSMxjuQ8BwUzf6gRcJzMEmYsiI0Z5rKZoaf\nIQF1DwNGRThDDVEaWmzcuHS2vqkGTaNdYhC15VW/vtkKYULV3/1DHQ8wpsuv\n3F9pbUYMx6z5R4sMLae3XQzzj6Uzzw1w0r3R/NZyUTJlTMhwqs4fjwunxEts\ny79jxxMrHFshAsBiU3mNSUuZr90CLLJ0zWQkqTz9F1q7+KRlTyEmNKCJsUpE\nypL69du4bnlp2hmEzG5h9jLUOyeNqZktM4FJUr+f9FwRqewo5nyuRbWdtZdZ\n7ncX\r\n=ZAgr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f24468e2c9c308dec7908a787411bd91534e0b96","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.6-beta.3425"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.6-beta.3425_1641375390499_0.6009024219946275","host":"s3://npm-registry-packages"}},"0.14.6":{"name":"piral-pwa","version":"0.14.6","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"24a3bf3342a333c290db39f33579162da4b349c1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.6.tgz","fileCount":40,"integrity":"sha512-RNigYUkM3kEC5vWrqOgLJvcAMEJZ80v1fJANOUhHYNryenlRwX7TJjrijSSHUxqnYMkkBPNXxDrxUP7Kn0Oz2w==","signatures":[{"sig":"MEYCIQDoJRAnczd6IsGNswuBF6CPWtCNAP/yPVmDAtN6KZwXhgIhALNMsO0Qffd4Ud47QDJ30WNHOAFvWCZytMJ4P2uXP+9M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1cw/CRA9TVsSAnZWagAA1o4P/iLPd8IM824twcwtTLw0\nUMdq6CZwAeJb1F5a51Mg/Qw2iTwMT7tBrC4qQs1DrMUuFCKuvlbzu4FpiZkp\nuxyEkqctm0WCh4yJ+lv2ATMjS+wgV5Lf7aPzj7ElG417EhzChw3XM9Ib/9nG\nijvAxlEXZ3GG3LadA6heNxef2HIYzTspN5W7eMIEb2AIQx8BpYRcpQH/x/Qq\nbsErEiVkhlUVz9HeZx8RSToDe2C0BvQmDr0B2SJaapT3XabJXEXnYJXT2Dr/\nRe9flZPxOfEThpcw0TyAolq5hIf8BQWMpajT0cweDer2wEHva1yOW86wD99r\nUz7BF0Oq/kWGVz/xa5gEF1+NAEPHxqBfYBqWvJWHnkmb7yTu0TbWkq7jzg/T\nATKlR2V7RSZNhLmPqYYhoAIvNJYCx2xbLtZHcJonm30Wc98v1vY71cTd8Pou\nu+0tk/qlgTH9ctUg0FSXLX9p705V2UiE5QqRb7YZ0l5LdK+lSpgZuepIuJa0\nJFjuUHnKvHzjgYzYHMcXUorj1QoNBfNmdwP0jfnder+RD/OiwNtrlBeNSrWo\ngBt0psDEJTObMUQrgCAWZT7PVZf2oxNp3zNuYEnDZLny+Cun0oHDQOVhrTfi\nI70h9Ur0V4ejkTgoFw3PX6uj9i68V19wF+RpttP9X1M6qHJP/0WCYhaMaNWg\n1Cqy\r\n=Nn/b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"58dfd3dfc26a8856b241be5220b0fb8932107dc1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.6"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.6_1641401407792_0.15891562379982282","host":"s3://npm-registry-packages"}},"0.14.7-beta.3428":{"name":"piral-pwa","version":"0.14.7-beta.3428","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.7-beta.3428","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b535070b29cac1232198f35eaf0cca3f211ab6ca","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.7-beta.3428.tgz","fileCount":40,"integrity":"sha512-EJ2ZUGhx2DQkbnz1wXidKW4EUwP3wTXv/qN3owkixiNGRAT85ZaNFZ3aF/0h0mxOFArn7IchoLeoiXghL7KV8w==","signatures":[{"sig":"MEYCIQC73C3AJ3agAPmw13CnIoof42CNmOySQdCXBntx9e5t7wIhAPTxYCth1DVMYwRftsU3kCHWNOQ70KpBZEb12zd6pUV5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1hG7CRA9TVsSAnZWagAAsoQP/2u12STBqiiyGruijam9\n+vU1YnnFTGa2g2Q9v+mfJqOo18P1Vu2WcyB4a6q6U6qGglWpPM5OnZA3e9VA\nRIsL8VTabihChqR2sqiGws9z+nHXm5YYxfnKoR3P5dC9GdO9zbuJvUSbyaOq\ngciPfZQUnFJrSfdawR98k3LFamB+m/44JUqaSmCkaMKkW/9ko9a16iouLFSB\n41yir/JqqDtSkkI+hXA5TCw4cFqWPL8l1wYaKy/z7JbL4kLx5LQoQlMYuj2O\nGN76puutYi+xgO5nhQAE3CoPP8yCoGCygHAwQVYLl99QQN2N8nhttjhBHCJ1\nlnVL4RTGuEMb320zKDOgRJf79OtA8png3P6bLvO9+R4mp/vtIuTvH0Dd93ZG\nwrM5yhHjthFnq5Chj7w1bErcNYJKgmet/4cUSRmzEHJkYfbI2FjRkhKC0lco\ncTpx5+HGsISdfGv5mD6u7uzu/bo/QkYAjbj1XFRaKYswZqw5/7uqfJEmnDdj\njOVh3HIvgFY2pUoHy1UgTKzitRGPXe2FxZ7WsE+S/GEMKX9tDyhYvhohvCnX\nM2GUas/54HNubOj1JKdPeJcnugRP9YAWJrwd8QWBIRyx2IPV9m6/mEm1xlvX\nGlkahddaMcDCmR2JjqwsLuu6PZvcnenLagywlG7BMNZYA4gNOHvG9nNsKBmj\nixXK\r\n=l8Gj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"68a26b99cfdbcc8821335ed03e1446b55c358692","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3428"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.7-beta.3428_1641419194979_0.13585346892254013","host":"s3://npm-registry-packages"}},"0.14.7-beta.3435":{"name":"piral-pwa","version":"0.14.7-beta.3435","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.7-beta.3435","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f72fc50665ff751f346da815b29419632daeca6f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.7-beta.3435.tgz","fileCount":40,"integrity":"sha512-CufTLfagLT47MqEilkIJZXAGDgf9l/QmhtipUFzMPfDs+aDCPJMcadfnRDoRWLbU8UYrENJkCPn8yQ7IrdIxtg==","signatures":[{"sig":"MEUCIFLg+D0J4unA3MpWO8PSmQ5EYegIH4ryYBDt02zqyY0wAiEAnlGFs4MuDocsdbmSsSKRc1gTR6KqXxkMi+c6Zl/h0Fc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2W/TCRA9TVsSAnZWagAAnhQP/3yOyTZro/OeGuKBBamv\nrNwk2rsJPgnTzxozfnuS+GjDkXrNe1oGw72m9zwHWu2mUi/oofYH0oM92QmO\nLEWDNy26QzU6da2hH8hvMEqrecIan7Ao7Pm1PqS8WGOkmel0pIeQYrozYUhU\n4rhhTyCaE9GoLkhdVFDwZHKk5ByzCQ3LTYuytErxH+pW5rwCLrZOpKus2liJ\nq6P0lx97hfEk0LVCqRM8K2zu/oxvJ4bntrQ9w7Vzmjw5mEh0J6WytBiGsMNe\n8PykkwcZ9WPO2TosgpvJqCUgvsJTSgyjELkKNJxwz3stGDVbekVMl7ycq5lo\nBLhPAbCi8WtYssTfwfaFRI1Cg36XeU09yDs18ndyG+uPM0XZDg6ULiRYEbYy\nourC1jyel2PjxaGKNRdyVhbnhC0kD8NH2Ug/GsTJlUyZO26JQ0ApllWRwjhx\ntfFTQJDkTJTp1pKLlFyNPXMaYatFsaIoJE5sheBcGDV0KcexIt34Mxc4jJC/\nP3W5e+I8QMLRDwddTi8cMN0zIw0pB77Z9zQRNVq3+twOW7hJfPNDcieNsr1c\np3mS8gw1UrY3cQhVf6ptQX+ckmciqDPV7IfmUdkBp7TT6zDESe6jbcZKxOo1\n/9Kxxv24JWnPi/UTkknkXurkRd4eAuFDXuQcLvsyP+549owQ3YTCzRTPsNcb\nhP+/\r\n=SGrT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"abb9340b35e505f687b9d20eaa8f496007ffd976","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3435"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.7-beta.3435_1641639891487_0.3702450903997132","host":"s3://npm-registry-packages"}},"0.14.7-beta.3438":{"name":"piral-pwa","version":"0.14.7-beta.3438","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.7-beta.3438","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d1a97b4f3ab4f3099c4afb563100e61ca0357c77","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.7-beta.3438.tgz","fileCount":40,"integrity":"sha512-gxUaOPw7R7y52+n7JbkNDGuUwT0WyUcYZIpX5r8NXv0k2EjzqsX1pnGtpDBntzgXqd3vDvlHXKzo0N/D41GJaw==","signatures":[{"sig":"MEUCIFdadiI9y9Xad1RsXHl1Q2u34hzSgObH5iII34IXFoomAiEAyaWmHcuftsDdkw1dmOaE/Lc5COBXtXPIFHsrBtFhc1s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2q3jCRA9TVsSAnZWagAAXvoP/3U5eqPI/l7DtF77ETSa\nuPP2en3Hn8H2tJp6bEQeBCKFQY16dayRZiDRkViftl50BFnvDrzDP5JDI4fC\ncOLLdeO5FL4YaoSRbE0ErnTut6EC8p3MVUhHyoI1O/w0qpnsjFdETLKbDgjL\nPTTK7FPCZ7Pmx723J4VObyMaw4OBVwjlb6LoFnvsV8uEZWOHloAs4d6YL8DB\nHWxtTtl83ageC/z8qEQbfS37WbPohGVXLOOq7LIKyelhAeEG5w70aRLzeHVA\nh23SeefFhn6W9RoHGDpbZMgOnDA9S0Lb3L7dHWKm7gNJ3/qa7erfpeTrGIbF\ntnpKujjCcHJYZFljIKEK2GdsAob/9HD2p849QAxJpDDSlDNsvAlBIsUuDvOs\n+udiThPcQHTQzb6i56MEnxqi7WaG2m1fr0/YX1ydZxpBJlfmLvQ41sSSrObJ\ngLO/1c74FkgJcgYLO6XB0kSmBSE67zPwqy0x2+Dq7WA7vEP/TESmNramVtVr\no1PqGz6U9rfPW9uTz5I0xT4m1wfrZ6Kss/iAhh/FZ+lnT6nJOGKbT1zvMOw1\nr3yKpWkQGMMQEkOHGuP3GP6zstSxjNhuCW5Xfdy4hK2IrZTgLzC9lL2Fl7Ie\nChb8VRZbiILmWYI0cFKJx2xX0RpMWd74Mv0gS3vkPmRUVFDwpUEjeE3m4aO0\nmlER\r\n=+ee9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0045ae2a368207a8b346b07002551552a2882a43","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3438"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.7-beta.3438_1641721314993_0.9828966426322929","host":"s3://npm-registry-packages"}},"0.14.7-beta.3456":{"name":"piral-pwa","version":"0.14.7-beta.3456","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.7-beta.3456","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7ab9f3e09208039314a8b6f921381ad34b97e3cd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.7-beta.3456.tgz","fileCount":40,"integrity":"sha512-yXkRFQbqYGaYN7NEdwGn4aR1ESE92Z2waLZbIJkq+TNsNpnqGwhGEbnTD4sV46lZwGj9Hwd2vdmvdAkOBm2HMg==","signatures":[{"sig":"MEUCIQDD17lrOjyLh2Pxr69QX+XVzE5HNz568szo9s/I+8ViEAIgOiDWY3pOyPC6L5eyeE/YHHCyRJaLCzeK9A4WdaL77Zg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3BwACRA9TVsSAnZWagAAmTQP/2a9lyJvvThRJ4gTk/i+\nyR2o1/cpZo38BSSyhfbTmBR5hKqJqM3KwNSpXeDvZCTRtVBSOg4ANDjPirHw\nHvkDxkLifHsa2GUfDd0eWbOW/pBn+7fj9QFZakiF76vNYROEdelqdtCDyTlL\nmTRVu++/ZzpenOxxPFfohVTiy7+EcFmGzpz/03g3Fp6yYjvITINv7kRwDZvs\n3ri1UA5zNqoERlBO3cc1F2JvqYk3uBNGj6L7k7f5ciU67epbRjIOve1MsT4s\ngPRSmgn9r04KF88AjhvHwu4oeG0joSEyIuAyetO3KSyQQHPErglsbfqzzHVX\n83PRKPcIoz3jaSuSGliYtmacx99KrhQqB0jRE+Ci8towWCTAJJHwcGxKX3FQ\n7sVknKtxl4oKkGH5H6wuf0I9qKDpFaJZ/IftyQV2jlR8BFR0TY5d2GGrqwpm\nwEvQh6ChhYB7szQ1j6RAmu3UNYrNtWjcWe091xGexh9xHCj6+ADlw9APjV66\n/cNaKGiebcXdyFqv40SO4sILHCXQVng10NTNAnIzRU9cS8SbSCaqJS55Xd9S\nJrdJsbrWvgGg4YOUaKnIr3YjyPvwXZBLjLcCdaTZGOmY2QautZcN2mHfXIDU\niDuc/Ef1Ff72a5p0797mvE4ebqeGQv4ThSc3rDrv/iqSQy9NzxLiIaaPUa6s\nDYnS\r\n=2Kep\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"38955c6a6d441bee3ca3d737af02d02f54ac9e91","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3456"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.7-beta.3456_1641815040584_0.057807625564587184","host":"s3://npm-registry-packages"}},"0.14.7-beta.3463":{"name":"piral-pwa","version":"0.14.7-beta.3463","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.7-beta.3463","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"304e9c6fb7ec0fd49c6435bfb6245e8143e2a1ef","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.7-beta.3463.tgz","fileCount":40,"integrity":"sha512-Oz3WPabx0W4yUA6iRmlnl0A4UCSqKz4Xrejn+o28mv+Y/f3luPplLMa8OMZEXLM9+/felqWYP2w/kY9HNz4oQA==","signatures":[{"sig":"MEUCIQDK650LuGZJl07jxjw4pqS6xu6dWGDjwZAFJsYHOLUPVAIgZ2Yps/o8WRymQZYszyiLN+GvRbGa9EaMlLgEIbsmWa0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3DW+CRA9TVsSAnZWagAAU3MP/37HIxh6d8JCMDXF2bxH\n4FX1X3RBsUQMq+03uUcFRglT2k5PjBnGmVKlQxIMdyXZhEGs/fpzqw0vpx9Q\nf8gM7U/TYy+P3N3r+N9GxgGoCSwafQEjXufux2XLTW7naE3O2aIH2y0uoDFN\nMhVHFpcEC1hgDVMdUZbQYfQr2CpMWNSql0QYkATBrRDGpSBxH34Z8tJOPvpN\nHZgcEFPMRe1xe2eHFWDVTIVGMP6Pvcs1NUidtHbkRw0UfBIPpBP+qTjCnu5+\nAYW9YW1CdEbmPi5L4Z3IKxZ0js/Ph76ExCWPkBHuhjGtW5WeAt0+XAuUmyHc\nfPrbtD0KLp3J1pBbvfjwIRkfvtW9X8QiS0iscsvk7YJdwybvGwOuA+/uhMAP\nhD9juViRRE+jMtB+7siW1V4X8RgiIJz14xepLx2xHmGi2mCAyD4gL8Uqoy58\nDeCmEsGK0K/zRLWcWyposb6qKDo5hj0pV1FhhwWgSq5Vrjyv9Wpn1rIapnvP\n6Lwby2cEqjZAHUfCPk+L3lqWuXFVeL334GSvvUzj8Psa/hgEyKWA8i4Krbc9\nUN3nq3YgqMk0WLCkDY5VdvsWi2Im+nm/pObrkJfRZ5FWhkMSaTvhQxM1O31W\nmS93clN0zXrzoMsiVYXl3CAXi24x+T+YP4ICeychM3lz4c8c27EFAhNaOBzz\niESy\r\n=N/hU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"46f8e649fd61bfbb49a7c24d1ff60e5c9435e4e7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3463"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.7-beta.3463_1641821630809_0.19312526193323398","host":"s3://npm-registry-packages"}},"0.14.7-beta.3467":{"name":"piral-pwa","version":"0.14.7-beta.3467","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.7-beta.3467","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b66a62594639db26b7a5e2d3ddbd4c6a3b0a8e50","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.7-beta.3467.tgz","fileCount":40,"integrity":"sha512-n6hkTR0d9u0Ina+FfHkl5O0JGMO4QNks5gmWdkwlzozRvXUlcyml5atjfodjyshT70ZBkKCKjYSsIsOKUkQRCw==","signatures":[{"sig":"MEYCIQCqtDz/ZZ/W2BV3XRwGkq0nVARc0A3h6OXWyGd9ka75dAIhAMrHjpEZM6/D9aPYhlkClOvdRnFA7KLAEzUJi2NtLibW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3WBfCRA9TVsSAnZWagAAJ1IP+QGT/f67EBdyOuWnxMBB\nixMsi2lUWqJl8jZ1U5dbcWDdqYsP1FFKVFDlxbbb6VLWvFPdNYjUDlR2ZXDf\nVSCwceJz+CCsc13i4hN70RzZXP22XOaElakJ9C23QdMLr8weycVLQ371vlYa\nWPVMwyjqSeq/BXHWVKHB/OIRrIVCn7ppAjy5x1XpHKslXmdcG1GfkkmoDBxr\nn0V+JLHHvSgbnP/7PP1yNmqwrkdD41kreOLnS5+lzOP8go6cecIuAhykXnX+\nmZ3H3z3Ucja07doIog4Alr0PmhFM//mKV4e+5y+fbkySzu0gaC8nNYIAjIws\ngrgdyOUbiI2vn/NXQnT4dzzRPrU8Hp6AVGzrOmUN73do6qcINA4+qdP6IHLD\nGv2OqiqK+F7shJ6eS6qeqk4Vvoc8lWgDgGkns/5wZNHvi+q2BRBlGvfe4QWe\n3LE2yorusqn3lXp8gyVXttCurAsve56tcM2wv9Y0N/dL5Xq8c36jtHz4l3x/\nXYHszeRJMHYo06K92EK6MeesoWzTasKlLVTyaAegw66heaoZr2t4TscXb7TK\n2I5P7BpoVm+KW9eix+Tdmh6fxI/QpdwNBX2a87zxJYCfuQVXGUyZfG+HGgZx\nYMDYIJsv5+DYHBDF3TsW0HgK5cnVi061ynL92+NQGYMDWXzHghRdoWU+XHFe\nqtOt\r\n=FZ07\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7e212b074a1788ac6bb0dd0445cebc27e7c036d1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3467"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.7-beta.3467_1641898078928_0.8339351819384906","host":"s3://npm-registry-packages"}},"0.14.7-beta.3472":{"name":"piral-pwa","version":"0.14.7-beta.3472","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.7-beta.3472","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b022c78361a8d1468413100a352bef843e5747ba","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.7-beta.3472.tgz","fileCount":40,"integrity":"sha512-j+ctXeTT5OCQJhBLDhyim/9mV4TVQnUaGYjj1Le6f8yD9lAI7D2wDjCfdNS4e6ZyDvXGJGgw+Ie5cRk25xQmIA==","signatures":[{"sig":"MEUCIAfmsKG2odKWqW/RzMl30ENSdTxXb6I+xL7OwVXYn4iJAiEA2CYhtQ/hcwTZEY+HRcgyWOtt1a1dpHgL9edmyosyty0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3jCPCRA9TVsSAnZWagAABC0P/3457E4NmnNTk2AEui4y\n/WfHOFAsNLLsQgSczgGDncRLwOzFb/H+tUyje7hNtqggWXV3P47c0s2WIvgX\nK64xdekJigc9q8lMrRHrSFAzdex0hERJqa51Dk2KfUt2xgvt+z8TyWlCq70t\n0iMFRGJZHWGZUDfxUCgFhNZqilN8nekm++sg4sU3ljPnmhn0fXk4uYBRdBOX\n9C0WEU+r199N9kjIOLawLRk/p4zJH4BkUR69aPWZQiYWiJ8DBPUsE3ZTlul2\nSW3jTq/Q8SQrqb5J8GB0821AXP8vpmQhlyBnXA3SYbbPG9arKGWFr3YRsknG\nq0tcEyTgCNy13FHAu2O5MfGaoCAkoWm7aQs9cR3o/dbLG3XmN4ItSzcL/k9l\nwtbtMuLLYlsPSY3LU6EF5AI+ogI2AALYAVfcUquwti3HX+7uVo0vTAVTGQLC\nYekeKBpPTP4Mtc7lPYeRUj8uc2o576Kz5B3Uf4FMal47yfDVrxqTHTj2RoyJ\nMH/JHE82DxfZFOa7YAaW03bZoy07M0mpMfjUhf4EmckyG9d7EnjkOJKwE9wn\n5T42MJYKA/tTtj0CwWua34QTYvz9X2D3DVLROnYF6/WxCXMJZP93licZo91O\nfS8EPGAo9RMl2EfB5+c4yRWjfib7WX3NHhJqlJc5hTFGMGyh+zktmXaqXFm+\nmZjj\r\n=SLHK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a6f52016d1e8720feeed91d2fa5234ca72d3fbba","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.7-beta.3472"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.7-beta.3472_1641951375620_0.9304991090629691","host":"s3://npm-registry-packages"}},"0.14.7":{"name":"piral-pwa","version":"0.14.7","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9950127c312322cabf3dc1bd03b260767292f51e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.7.tgz","fileCount":40,"integrity":"sha512-ayxuZg5n1wtLdMRxwupw18SvKa4u49lghAkPfLsdZ32aRUb1PImx7skOpcqk89ud79EmO3QChVPVJJEGhRTq2w==","signatures":[{"sig":"MEUCIQDrtEydInFyyYweVnxYFWswPh7e5u7FYV3n5TnuVQ3wOQIgNAdnlAhEEcNsoLpsqiPOMyMq/cSIjDQcrMqbxT3MrVs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3p7mCRA9TVsSAnZWagAAbdAP/0Fpq3V/MMPy+5CRk4pr\natEhW/1DWeX8RoFfuZ85OtM0H/+YxC3g9BqfPQ+hEDrdm+gElIrRcX/qvIef\nY3NHF/RFvCV/+k06XQ1Zoy9S53oS/YUlaNkWLtXshsj3PQBZvrf7VaVAySp8\n+ofL08U1t9YLMo7T63cnxxYF2+lWPMnZySfwDWugR9bW1e/cR6XyDS0ps/jO\n7/3wpcXuuoJtP4iHLnBOYr8L1JTBkIeYcwncZjGoc0/zJx4eL3ZCRSd3l+WW\nN1eycMK59KHKH+mPIZDqC7BhFGqo08d7vW02tt3HP3Pqo13CtVcyd5UN4zci\nADcHYqAS5lEneU1HUDlLe+6//i0io58bqun1ChGteOvl8GGUN1Mfc7OHOjdb\nLk0eYJslrDgup0NqOIqu/lDUw2SajOcZN016t3ptF02lEGWFHm73lZlXVuOy\n7JYXUI+SzUwTdhMLquyghVbBpu0H5dYseaouFkzlELqYL+Y2B1G6J/aiwCQt\nX3wLRuW9vI0sL9UYwpNKKGFIKMd92J1YIq80dBVh3aS6G8suUhwMXAem+cR9\nmjz2xV8qe++TlLJJoRpXDUG7SVC1dLj6tXEXjGbjcVTc3GCivg+dJTvSIvrH\nhg33u64qj3O6HqxyJ8ZRVVuLVg+yBLzdJQiY/iQLuY7uaNMRuI0Sl/XiFInB\nNhPF\r\n=qZkZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"143f517aa087175f9efb1a5f17f2ddb284adb3b3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.7"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.7_1641979622045_0.7669907768464375","host":"s3://npm-registry-packages"}},"0.14.8-beta.3480":{"name":"piral-pwa","version":"0.14.8-beta.3480","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3480","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"024ca0afe52fc074bff2ab57d870d22e3e787852","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3480.tgz","fileCount":40,"integrity":"sha512-NAg9FzJWtjbs/tPc2LO6sAhU9hSty8LA7TnuuxMLbBUZ1aYk9j56N4CUfVIRWMVS7N5w+Z8NVyAXfIYi+gPGjg==","signatures":[{"sig":"MEUCID/v0xktaoCZjt0np0c9uQj/wg0WFu+1iUwVnmigGiIAAiEA4Ean2PomTI/PZyP+V0KYzNW6pEpPIW6+Jm8gkeoKmko=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh32pQCRA9TVsSAnZWagAAB0oP/1IggQPljaPzyTZ8zN2y\nCtNrbOOHvqAEuF4xDuK3z8tghIr0pqwI15FKZu6/sqjWSohJqdqvMnfXC8oE\nCKLctSjGt1P+fDqF7URAu9UEhLxawl+b6FmO6+vzsh1dbtQa7uP8C9Jsm4Vl\nBodWFfXSngmcwiUopcHDmZ88XCRwRSVDFzH1c/zB2YonvxMeTIg3udCQHOPd\nStzF0OxRhNkoU/eaLm6K3+jhmyjkTKlh1xGCincT33ObqtPWzh9KJri1GD0W\nuC+by44SaoyZi4VV7z8UxMHzmkvulfDMmc6BMMmTtdBm3nQABIJtJ0vaa3N4\nC55oHAVMMnplbM/vhUwAS6NA3Gh0X70rvF2CFWHy5Sl3qSabYEapQRpvAB3k\nuHu1lJ6iCH/GRSMvZcZqobXdqeVcPuBOR2ccG56Tl6gy0LkKuRxd9S3ravce\nemuMzegIqImLW1+mKl5CTWsrgJFykq0ql+V3x415U0WTib/BAZQqJxJTVj8J\njQGd/A8RGWRQyN55BqhjaIfpd6D4yr/pXIuX5stsscXLK+CDGM/SCVsXhffB\nBPFUoRf2h56AqA29wPfQ+AHnX+pWam7R/YFEnIWeQ9ZvGvp55h+iPgO7FPzb\na73+/2ZweTUOBha5SYa0VPfYG3RyLw79twWIBqkmzIephRjyV3lAPw6pwcw6\nLvJf\r\n=kufw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a35bd0eb547a18a708af0df85f66a21aa76bdb76","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3480"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3480_1642031696005_0.32271567141937374","host":"s3://npm-registry-packages"}},"0.14.8-beta.3483":{"name":"piral-pwa","version":"0.14.8-beta.3483","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3483","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"260730e3ffbcc0032aff32241bf74b7c97c5b819","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3483.tgz","fileCount":40,"integrity":"sha512-7tNkgHlCx4wgXKExyK3oemhK4svmGWc7/r1PaUkVOdaV9olFyM5JKW0Nncqg/fuELdDbPZ1QMsT4XhAsyNq9mw==","signatures":[{"sig":"MEQCICh2uUxAKXxEWUK1whUzT7BjnAC7ZkfThVKrieuJt7zgAiABDaL2biCc1vmNIvRf9az3vXfXrIn73PrxyVaBeoF7dQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh33DoCRA9TVsSAnZWagAAWW0P/3dkXbQ0iQucurCj7+CM\nPv90R6rNgVAYvTeZCZH3dkLLuRM9fZpR7xwJMGvIZsX8yashIG7FM2smozcT\nVdwr8ARcMeTESjWOdMoLMRBm5dqrDw++WK5Krraea1V4ahnXY/tV+IC5dAsW\njsJwKhp7U5Gew5U6F/WXT0BawmVC1LVeHdl1qnlLmXeHPOBTGn0euQYS2CE3\nzX6Ot7wlHpg/PQrlhhk8Tq48Te2itlVvdwkM3d4BZAcq8xGdpNqzY/hpHLhI\nukWsmjZGpBXY31ex44jXcrDoP+L3M+phW+ZpaFYYcdemM2vcJkH2fzk5avns\n/NLBpBLkeYUwNt5vO9W6xXFmYRBVkOgHF6PjBSjpz2Ft5h/UYNVTHsz+4kCJ\nOaVdrWs67E26JZmKRKbTW6QiMkO7EsSX8Ii2DGhPonEdCeNo9kLT02k3qfQH\nypX8zQHJL30FlNr/kl1TGCFlCdSDd15yhRXoZHQxpb7eKfi3Eh+7/IxL4UHe\nyfnvfGFTlkFGi1txnOxaa/gz66BCvC1WfYSQAfbAYcUW6tsewZVNiZvAQFZu\nEFR2zTC3Iux8L3wsN/gB08zWCd6b1d85d3hwxs2hkHS4IoLHJEwvxill6n/K\ndpGSFR5XYexZPpCPzw9Mkj6MnaRRyF66NQrdfsr9tZqZrKKy2TP8ef/K+Ksp\n7a1O\r\n=LrvR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a35bd0eb547a18a708af0df85f66a21aa76bdb76","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3483"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3483_1642033384375_0.38945365855004765","host":"s3://npm-registry-packages"}},"0.14.8-beta.3487":{"name":"piral-pwa","version":"0.14.8-beta.3487","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3487","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ee6f412211c0381754ea8b8eb615335766c74f8c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3487.tgz","fileCount":40,"integrity":"sha512-+yM1e+uwKhUoXYIT/js0qaJYTJliSL1eUrkcOz36NNAg563GhzS796E4j0V/5yfAgKuz6JeVCe9FaQP88HGlKw==","signatures":[{"sig":"MEYCIQDk0OsS/Ewr3EOhvth1dD7eN9dOqHDvpT4+yQ94OkGnXgIhAPJc4z9l2LzFD0hTI0bnM/ARin5V0W3HnNvugbpj16oP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3/C+CRA9TVsSAnZWagAAeqwP/3pZJ4FSi9h3sNiELDZt\nRAUBkJifpf3PTmBYx8YhFjFrLitAs+XfOWmslv4/hceQs7je5LWw7xv+X5IP\nlwG4HR9c9twem0inTp7bw3PQH5QvuMkV0Wxc0FcBN7D8lyTAR683edrzY7LL\n/YG9pAB0cb4HEgqMGbRJD+qF4dfASRJvnHVQX9zjdFeCpdDKBTg1X+LzmdlG\n0LiCKWWG5VPFXSNje32RmMW655ipQZaTfuzH6nh7/oXWr6GRXZvdvk1mqmTm\nMdDGf3a3dFO4lvdj53WAv2AGb+HLfl7BuTiW9kHJJlNVuybY/OpHxsETfy23\nSGsAGX4d4g3UqXwOVJimv4FzkgG95ynZNAuHQ7zPmUbdt65yuVNJVoSqRf0n\nqBnzgNyemPohNaU6ZWoyqOXbEmrOzKjZp++dxAfTXHozzWNE7iLq1+qTMY72\nMONigPsWyTODcJ8y3o8ehTqYxfWoKYwlM8/Jm3ETIlW/oC0r4q7NdSE20oJf\nFo3KmmqBjynpBgBr+58AWfipFI10oxFVVDEIOJK8iGST2ZzPsshaTUQgcvIL\nIDeMQWlpFu8GLJaiiSCYYa70lVHU6qrS99Dyfs1a8PUWexlO0Mo4w7mf0X6R\nScdP9fefbNAGmWUPvz8lAmMTtbZEKn2KzB6VQAuVqugFGhKHVc+FmFA+yScj\n3l5N\r\n=Blwp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"95872598216edbf8efd99c8b7044094ea209a049","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3487"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3487_1642066110259_0.2845639311513981","host":"s3://npm-registry-packages"}},"0.14.8-beta.3490":{"name":"piral-pwa","version":"0.14.8-beta.3490","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3490","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b4c7add9e586ce58f3d17181d8b4b62693b83d31","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3490.tgz","fileCount":40,"integrity":"sha512-DPxaFn4eahkVYaM+vZXeC7Xst9iKHJ/c4ikME+w5SyFTtwQg7tT7/2JJe3tRSGdE/BUi0RIeg0vNnziVaYAHtw==","signatures":[{"sig":"MEUCIQCxE1QP8kypXbKEKOk51MJgScmOQePj0Uuzb7zg+qlUoAIgL04KFYh5j9IWD4jjH4gO6uj6hvOw8C121MyGNVkF2b8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4GOlCRA9TVsSAnZWagAARTAP/03Sx1OBVdmhzTZQFppA\n/QyfiNiJbV1t7oTNTM8o/gga+L/nYdpoIAzwOzYjjGvxHUO4HHQZLlOcOX8H\nvG5DleV47cn4mYG4V5Y+dQwV1Q1yzT9T7yippfBWCrlUG4JJN2BX0BHcl9vH\nYqPC7eUT+YCH1TEUEMsALkFPXiSlb+7asJRRud6+cJp2CVtib4l7xJe9pWDK\nuwHIqG1hlu5sD4HDeXTviNayH/urQQRLKisRxluLkGGIS9rAzRbCtgsJpYxE\nTUsNZut6NJIggNH+/tnaBThzbQG/jdAMTtzE2FRifehmtoFCvtibgFP/JoeB\nwfksuYqxfaKrIHnvuWV1afKOOXY0gz69ca04nJNT0dWg/qhnn/QBhaWtNaHD\nj6drjYU8H4clgg7Mc/Q/tdpiA8K3x2ndbx7qo5lFoA4Z7vYLE1pH1MiYBInk\njq0kd+fKPHN0kmJqFXvqYAGUJTrJELrIe55y+kbrefwJqFUAPUxig/I5yQcL\nhoQ/5ZH1AYoKqnbWaEGETHmIfb/kVVtGAAmPgTJsut2jAFtrLbQUo9D/7tPv\nLRcpzDmwc2lrpU4ygx2NzR4nG6ew1huUot36hZ0tgw6Iuko6avgP1dIqo2BC\nsorbGcQfqbVSLlM1CDpQH7YgbalLmRHE/Ng3Q+IiPO1frg6RQK6UPlr4juI6\nwtlo\r\n=MnjL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"c8a70566a926e3306ad5aee94e0f3f7b1bc3d690","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3490"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3490_1642095525405_0.5065556267889408","host":"s3://npm-registry-packages"}},"0.14.8-beta.3494":{"name":"piral-pwa","version":"0.14.8-beta.3494","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3494","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"eddbc94337f651e3e58c602c3b8bd2fa1199356a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3494.tgz","fileCount":40,"integrity":"sha512-u8nDktTiwKaJ1j1hM8zsEM8wnD/1VFcBiCN1ouxnzxiAeWDLU9LblR0wvtT2BuC15QofTnC05wKuRMAdw3KrmQ==","signatures":[{"sig":"MEYCIQC6kBEncUIwAVvDLu3jWI6SjrnlRkQ8qzktlj7a22VCBgIhAPYljhan0TZ23oFx56ZqBtf2RkV/aNUr5nZQoLoiV2jj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4o67CRA9TVsSAnZWagAAnR4P/2SXR9YCYWQ1bPn1AXdq\n/nKMLmr0hXFe2KjsuWzc6ytVn2fsIFQROLcR+duez/DyT0dO/Iee/ExuqsCl\nfSx/eLjahT9nPyPf7bdH8UsrMG2C4a6aH5/nyL0oaolA4Y288IC9tUl2WwZC\nQzKQXZthb1X1QyTk4Q3RxajQMoNRJN8426Eb2Wsljft4tX0zppZov50Nh1z1\nDPfh2dIEHDabcZu1G+S8xJtK4TbzPcVTwJ8nJb9v/tEP/tCzLayghgTpG5hS\ndlmGTvUOUMT+j6JOx/HxN9mY0e3cYFPP0zDOe/WIx+UuvXUEaPKI4YNn/npb\nMKc2Il1jqSM3dD+YYCknfxDkmOvKwg0MlG7TtgVdWZJ1YOhs0lrRt5J+8h6u\nziEGcOPMCxFW0bYPEvW0QtlLarCYI2a2loC1W3ezuKsSWPcA3RuWMIIRpQso\n2HmC8I6MgyryGi02HLFQGzqOYZD+kziStrkM6dyXbO4mZ8NXptyD2qVIomI6\nEHprOl6pgBy6umQ26kABR5ddpxBIy42HQrVuoPWq1P9AlY/KOGxXBZnC3yjw\nzt0rb0eoAFnEuKeoWkaR7pX0tFae91+QS0A7ULNTbIIHK2WlkjSGI8UdjLVX\nkdrRWnIm9u5g8oaO5tcZ3pHqIOSN+R9H01Hgi10h7axULZuxwUCFNoNOPHBO\nXIow\r\n=I/VK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e0cf86abbcc310101a68de1297c4c9104815cb77","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3494"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3494_1642237626980_0.19201902597983533","host":"s3://npm-registry-packages"}},"0.14.8-beta.3500":{"name":"piral-pwa","version":"0.14.8-beta.3500","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3500","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7cb15c12e6f9fed556f2e03d37f993f3b3d5b4b0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3500.tgz","fileCount":40,"integrity":"sha512-cGbq6kULjaAyjihe9MNsniaXkpQm/LEp32l2sjTluWe/axxewQAKvNCHgjv5S0xm5sbGhIU+LwgnqPfFoCadVw==","signatures":[{"sig":"MEUCIGN16XfX5cYtvxgerrWoESwxutj134Vmq9DVPqLTl4TBAiEArOykBUWiwdgLeauB8Ui9w+FXuITvh2zJMbuoTWZYcIs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5WJNCRA9TVsSAnZWagAACjQP/RwUJZCVZX1SXmiM4JdC\nz9Qb6fzL+s7b5RuT1BVWMRDQsULT3gxrFlsg6HS7bPRPyl3F7bw+qPLG55D9\nrf+hWXUAWn/TjbBhhuya9UTfzYBgbYM4DRme25Pz++0q/15oo7X5yWJQbsmM\ndGFcklmCsMft7ZgRqRv5kwofBGvFlMWzLvmsRGmIjKj7fzOB8tI8sIYPynT9\nmf4SO1Ja3/2z1lZVaSa4bga/f4Py1+tFYV0AHdusVUZw9Ect55a/7+eY5LOn\nlRKTXFOKgn4amL/IV9mxdEoqAzq2w/q3YehojSLhN4vUO1AVnzCBWK1/0dfh\ndsnXqz8p2bcCUu2ooGrIHwGsq1E0xm9Z32GH0FtoN1d14jWChjKzkfTk2mPl\nUMP2EePt04dmjSpiym/FJTBAyxte2qRRH9KbbwQgfOkxFaTne/wEtv1eOlT2\nWa5g7yu2c5Fp04dp8GKslaK3G+XfZS41FiJAg+lFut43i0gsUJTOk1WymvHm\nuLQtQ1ZvgpRq5DWu0GlUUtn9mhk9LJG2eJgF9fyQOpC6Yg4SDJxg2ht2MfLU\n3rnWjY5Gq4Vz4BkqmNI69KLJzxGYFMgMQZbVx31ltGp8jZY4Rm40YX4nnFux\nr0YeR+5gSlqhpArtx5i7khYJzqib7B2KFvVoRZpxxEohdGYXXfkiD2VaahDV\nQ9tS\r\n=Vy3h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"89a719e1827869c9953f9c3c76a338be59e31b7d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3500"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3500_1642422861410_0.10518799828188818","host":"s3://npm-registry-packages"}},"0.14.8-beta.3504":{"name":"piral-pwa","version":"0.14.8-beta.3504","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3504","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"800b0e29f6bb993af224864e2d85bdf3381cad89","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3504.tgz","fileCount":40,"integrity":"sha512-fYXTYgrp+EBaJ+IM6swTxbQLH+BuUrzlMcPAPWbPLRcz+K7d1JLFXQ0wCTQr8ksJ2qFyBnnl1kU2gtQnypbu3w==","signatures":[{"sig":"MEQCIGvlP5Q+PQvjdEDs4DuW4Top5Ox1LKBRE7UPfVCJfDHPAiA2ICpEb2/DAI7LQHEhQlLayNYBD98hUBiJI+o50yXVmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5wLmCRA9TVsSAnZWagAAJ1cQAJ71z7Q8+mqEfInXRg6h\na8uVV02AZZ3Kz8PDro3y0IEi+QmEjBDYOv5p6i32YPSOStsaAiuvAc5uzjqz\nR345zfwOvX0bsFxqeqr9YT+ofiBED91Fq8bXX2aOc/4buE+FpiByNb3zZXEY\n1ZXZAyxQVoJnTUsToTP70W5jlxpN1oP+SK+C+LJvCdpMlf/nLjOepGqqQFLz\n+E7ND78fMMD3haUZE6KV+0NJndQDN4jB5+NI3DuLSuaqAjrqtEh2jHfx5LaX\nF0jjHXYKhU4zPN/INqoxQKFBvICyzVhj+a3DMOjQtePwMlTlwH4Pw7vdcBXS\nWQmgsMClO+CSpwNQ71pYLaQZytffpvRxdDyUKiGqG1dOu6/ts+5MEx3kFHAK\n46qMSDI9J7aeB9Gl4xp5EQtihUGA48eqppTmGnGHT1quZ2xGc36FOEFPKxfS\nU8mY/KyyXjJ4JmFDxr7Zx7M3CIl/R1bmhOWPYe4PsrScWmt3gDZoQG38HdoY\n1upF2ggTIgooEQE1FFvrGcWuWbNIXZGQ/a1cKQSoM8at9KFPuBSz2NTFXw6r\nB/4TjbkG3QkzbO9hkGwSJuQIiHKkbJVMkiN7hvoLmB9TRbEJy2OpaBktGR+R\nvyGusijIabfmS2XmHCrEmlEeI4sfdXbGPEPCVlqDlOmLXeHynvx0gUms96ZY\nZGqn\r\n=9xF8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8e89db6eb732293e4abda6bb3c0cbe6fd0335248","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.21.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"12.21.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3504"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3504_1642529509952_0.4761058213244951","host":"s3://npm-registry-packages"}},"0.14.8-beta.3509":{"name":"piral-pwa","version":"0.14.8-beta.3509","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3509","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"32ccc4ebcd665e9e6eb6b8b5bf9c14d4902e0304","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3509.tgz","fileCount":40,"integrity":"sha512-jiXoSz/pcGsfqpEbWso2n4W/9cpCzhykEjpihpbNYip/9kli1j0t7XPZO4bKbtzXTHVy3fMnFNLkpNtCtGaWog==","signatures":[{"sig":"MEUCIB/CsO42aGp1uFNGDC0gz6PDM/HQQ7HWgMBg/MOUoU+kAiEA0ZmPocCRtyEfGBPOQUfgHnK5+ncDxOxvQTQ5brz93q0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh59F8CRA9TVsSAnZWagAATesP+gMbqp7Tdy5DtD18RfDl\n7m0bS8N4+cFTkWPNb2Mpcfh7hDRqF9gRDdx5CQb11diZVhy8NPkILwwM4zoC\nBrTgKlSkTKS8Ejs615ca5JbKvuIxMAQe2/svKN11rqo9tMQ8Zx42MM5xVXIF\ntu3wV6yfLfmVVkkxMbkL/xB21Si2GTzSXqtBObvbOoNm/JT2eHAPy8vdVGa0\ntCGCFK+uHTu7Azjap1CH9c1h/Yk/xY/VQeUUMn5iG2KtGTNGmCLHe5j/zWXb\nx+5MyCddpsaVCqYLNKUVbTmBDuNWhow8CnrJAvP8tbYfzihWgWcyGdRpNSO2\neMjLATH8VWlBulKLoGs9wJ9fcOv/AYtttaSMi4jC1K+oOtfl10prMmnhGXLW\nY29NvUj0kfvC8jYsYI8VfU2Uf3wsiYIlJ0Jcjbnl0ybUasBXN3UO9B1y2Ncr\n+gLnZEEcVf9D9JmRPTBecZOv6JK9LhMIJwNhWMAF44Zj0fvvMMiukrdcnyPM\nqptdUc1B3kIw+GA7ow9kINqtp37nJNvrJq73tP6m0Smze7K9HhgnB/7K5Qyg\nbdNm7kesyZNDMDM2Bwu6tBXbhl6tq+QHNIVcl0rW9rzUWFSvBslSvt8rx2KF\n62emsLzjvF2gLJWmfel7vOlFO0POcPSdiivbhZ+DCeFnXCOTDvlJmiBYLISV\nxcBs\r\n=+R6z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"309b0cc1deb3e3a7d717963913d0b834b9f484ac","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3509"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3509_1642582396016_0.7698144798849997","host":"s3://npm-registry-packages"}},"0.14.8-beta.3510":{"name":"piral-pwa","version":"0.14.8-beta.3510","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3510","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"678bafa864d0716c3f5f930d75c21cf96089f1e9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3510.tgz","fileCount":40,"integrity":"sha512-Hx9zz7Ks9MGO5cwp7FX9nXo8MDqdXmg7/DTKGysBawsHZfi4OTtwVZYIYPE5nnbdkVYyM/1H+8KNvfcdWAs5Tg==","signatures":[{"sig":"MEUCIQCgB8lGH7xNzkATdy3FzK4+m3CPIQLrVzb0xx6sQPYBNQIgSJyFFYudbHUCtiW90BQJ2dOtx02az4Svbh1CklTaJs4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6LE/CRA9TVsSAnZWagAAjR0P/3C64MSHzkSHSFeQ2ZI5\nO4PJGTZVIDuang8jCTJQybAfO+0JRaiKVb7K3Ek0EWnT7hEc7FXGbUA9WCDo\nRoiUjNX6UhK5+rji+jzBm9EB1iruymrgJ/vnHR1pMvvA1q5g/4nPd79zY+iQ\nU1ClqfjszFyvEuFzCWQvu9Vd4OePW4k6p8TmXyNOHl5woWqEKnecKVsI86Q4\n0htX1ALqXhkDs+8QSa8HozYWYZLbwmCG+qrnZcd3CP/L7SWuZs9bhMoHyK19\nFlrct4V6frLhPbZ78rhxZQy/Rm9bbh9S9UjmHyQCHeeQDvar6bKpU5cG0SiW\n1dFvXlsX9iEiDf8UkRTP4VKp2syttuLa7WPMqvL7s3G+czmn4SiX7hKKOzf4\nrSGKnJIV/uv+boKd8SUdzpw8jw3pe4Tk6qs3gWdE7QTJ+gb0IroweOuEL2S+\nPjL+3d9eAiCjfbJSjM5ObSd7upPBrE1/HfjtkkUV04dkttV2U15Y0hQdzdzS\nDgiFniovibmJxenoJ04w1sFCwiBPIqmMujtcGYStQ2/MWzbxvmA+sKr6zSHA\nO4vkXqqqqOZnFZwIaWoeidbbsSVEmajlzsTcovQtZZyVfOo2jPPbfC7bP1HJ\nB2y+Ttnxy/dZaVe9jNNMC5iDETtfYnBV62w1cM/LfIrrauJASFa/9RwfBKqP\nMwkn\r\n=laDY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"88ab7816c6116dc853c2cce595e0fd1456db5800","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3510"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3510_1642639679498_0.48193432364531685","host":"s3://npm-registry-packages"}},"0.14.8-beta.3511":{"name":"piral-pwa","version":"0.14.8-beta.3511","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3511","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d6531d1944b2c872844cf1dbb48b06a43440879b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3511.tgz","fileCount":40,"integrity":"sha512-3nAh7kwryeb+X+El6bxtgyKv2SnlV4uWnHZukVtk4MM+nTULMf4L8AVOibN5MTI0x/ZZeE8OMpBQ6EaxPa+h3A==","signatures":[{"sig":"MEUCIFKWMnaNDJy5qw6l5y2rSjVbxxVokDMZw4x8CJAfNeLvAiEA5Yoc2+QKpSIBndxrnZEdu274P0KtFrTD6LjtWMP0okI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6MKZCRA9TVsSAnZWagAAi00P/1wcMQXoh+yQ7a/r647v\nkdgc3lGFeOS57yIW1h1cU5GbWaPZ/4pq08E8J/7NVsRCDKQIz59xE+gNehkV\nuq4OiVNc67CchhzN3LaPuzZVcz4cW4ur8iuKHnbrYHc00RsT4YTYEFRCPsyZ\ni1Bho2Sfe6A6HwTYgcyeo1Uha+QvN4lt3HMKdPRynNKlilGtqnCQ23v88Vsb\nzZUYS+O1A3MLPuLoz+lS7q3HTvGfB8Q52ZqCn8T/GeTfK0pt0+sENlfUfD0Q\n2aOyEF2PVteL0GEqQqacaT3jJN7erTNMMwo96STQc+CcUub2Z6OsuzbLbuCv\n9cVP3QaQprpzrIfK4dLfyOra5mM2IC6yVjkJ/C4yqH8rBgozEjsqG3o6l5RS\nrCgCHUgRNT5FLwZVVfV+IqbW/1m/+0QJeWyZ0gG9gLlTp5JdwzzDpxVc19ZH\nuALod/qVoMv81D3zqWfDGkYDZopuCbyC952wezm07i7FhtcxxgtF3dn2dgvq\n8cJyk8DYo3QTLWADuoyMZjeiFic8r40L7V6Zo4nAn6OlRGUmGyr7wFMYe911\nL4rCbRqh1Q65EKv8KLuGb6GS7omEfK72GNIcDq2idWnJIWK2UqgWHs5QnKE9\nuzHPovjffzVRqiMe8nSw/mQGgFMVMW0xZiD9Xvm/O/OqC0kl9vTu3NpImIua\nL9F7\r\n=8RwT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"69a69677e9c44c0013c3220877978d262e11c9ac","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3511"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3511_1642644121417_0.11617709937379606","host":"s3://npm-registry-packages"}},"0.14.8-beta.3513":{"name":"piral-pwa","version":"0.14.8-beta.3513","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3513","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"92952750793cfb4f537b9a88585f0cbc66cbc5d7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3513.tgz","fileCount":40,"integrity":"sha512-SiJuIi/pGHzbd0U3pdOYGND7xXHos94S9UCasAaBx12w00IB/VaEBe4OnFscHw8sWand+bi68ES5GaxfFx7P3g==","signatures":[{"sig":"MEYCIQDnwTqK8cnCGAs1SpH7R7TPhXEeQ0CD22oaIMT9r8GgmAIhAJNY/P23zzLg3SDuCBKLV9G/pFUR8RlM0fDoI/PmdRLG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6TjaCRA9TVsSAnZWagAAik4P/2KTi+u3Q4tIuw/3ojBw\nL1zY06c41YWsyV3mpf7n5XttkI55wByPIzJg7j7DVyRZSM77LzYh6EyBAUBQ\n1yRsFffXQVI95kqprofE+FLrnAU0og737ZOOPw70nWp71ErDYbcS+Xd+RGGN\nf5KA0VXa12fx67wGfHOYMOSukqaum5WjmGxgt6CRR2oN9163APPKCW2MkNSO\ndWcfWBbPxTk7mpNg1kANAJcYrOAx1A1009yv0EDvjgz1DgWCjylDivG+xfAI\neolletrDahRw/emay3dvniVAs6jWZoAZF2QpUjl1MxSQlV6meSGnuOW/XbGk\neKTCj3rFd4qx790R7X15TvnVmS6VKvy1V7nBQOdkfs3/R7/tOXfM/TpuDtzI\n4cKMjrDUioW8gUhENZ/XII39yu6kH654YteQpkwvwroHHG5GZT/nU7EMRMSR\nFh0U8ArLQd3gJMZDShyd7aCWP0+5qx0hdjMQtbhXRcoXn2teSYtUP5G2Kf2t\n/4g8Ik8NIsAQUlk9PHX4x7EmCq3MNzA2LSVkp908XpJ75dxPUXrcC8m61/Ka\naUZAKjaPOE//f1R4ZRnayIGOF5nM4INhmDQApXEQ8cOOIkiL/YqjKa41n2R0\npmNbX38hYEv3ckSMJS82vo1ntfS1JTmBab9f+9iJVBYlxeOR1CFQnChQvGZn\nnvYY\r\n=9fo2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"082cc37bd4974de4f462a148753f3a9443f69730","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3513"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3513_1642674394665_0.3033606792264407","host":"s3://npm-registry-packages"}},"0.14.8-beta.3515":{"name":"piral-pwa","version":"0.14.8-beta.3515","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8-beta.3515","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2ddd0bb14c56ac894c5e6e264acdc0330a36f78a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8-beta.3515.tgz","fileCount":40,"integrity":"sha512-z5PI4x50A9ZAJ1ls9BXt66KQG08X+6b8Qj7BG2AiGx1brJoibISkJnXN4N3SSyQz0jwZihX62lsbw6WAgAWbGw==","signatures":[{"sig":"MEYCIQDtJLImY/VmA4igysuMK4m1ur+3dYeAftJI3NGlMb2FrwIhAPWhSPmaKrfrIf0auieYrN/KjkJowBkpk+iimz5jG8ae","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6VHYCRA9TVsSAnZWagAAsWUP/1sn14mah+uKfok1N13M\nB2ZmLVyG79XVxpCG4z0hhn/ulJbW7PPGMkqxvrN7m3s/cQhVT7VuWyhNcFDq\nPK4gEzN/W2mwdvIL1BL6B0rDgHpSaTYOxWO19J9pRyRPBiUY/V9EmkRWAoUz\nglwNfyVKdIuG5Q4eG1Ocjg5UsfBnZev/1w6TUoOs8KmVNEN12nw0vIGmHeCP\noByzzR2Y1J0ZMbL3u/CKkmkQZZLqMWanVVpBrIxuMuPXYzCyYixLyXHGok+g\n+6G+VTh11rqQRLBLici/rCs2kV0qL9Q8pj/LWXBXwi8epZY9qDGx2E3/HP7T\nsP1qsTLWqzezSDZ3J6GRu9ukbSnLEIFS/J5VVdev/EfXkmuAshETk5XWubqp\nT3jbStOGnIKrRCBFnRfYtt3K0XAt9088x/uHCtMCsF73yCEHONam1TvasT9A\nq3kWrG+5/C795YE9y98W714s5L4P4lmNA1O68ArNYMNQb0bqiI7Y/IUgyW5q\nHsXPic6mGIMnAHIBXUPhWNrys8hSpoLDtc0pDLmabjdVpovB1gwUOjiRVXY4\n0fER02Upi2fCdNB/Na6RUoGnjl9OAuEC115srIU9sARejtBMoZsX9hypaoqT\nLKdjh4AZwohUhstuabORRZl9/YGblHcbIFpjK6Th8w8qPkJUQ5kT0/nZ6VOG\nv8Tu\r\n=DP+t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"67b8421ae8c8da2ecde19e2dbb2494e092efde6e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.8-beta.3515"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8-beta.3515_1642680791856_0.8116743542902203","host":"s3://npm-registry-packages"}},"0.14.8":{"name":"piral-pwa","version":"0.14.8","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"df1b050a1831b9c868ffb053cf239704e50596eb","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.8.tgz","fileCount":40,"integrity":"sha512-xEtzW2S0URHi0Ui3V54T+d0s+AmuLcs9Q5xL33SfWrjtdQeEJVKMlOes4fuuGxF1FP6S071v7M6kT+/BrC9Sgg==","signatures":[{"sig":"MEUCIQCthcCaBF7XCnnF2QqzDC++G9qWXED2fWjIjxjDLeuOhwIgTsdR2QHnK3Er574NIJH8QRn1+fMjDiHBoPivXlqgW78=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6We6CRA9TVsSAnZWagAAJU8P/3BA7mwPpjF7qOA38Bmb\niRfg5vgOy7pfot5B8ep/e2tnF2B+jcZOfBACp6B9IIk2CiVTIYxx0Zw54yZf\nXHb3PvsfofWwsgWjpPY7EQj6NvYQU8+7EYDtsjEwwb0Lt4fYtYFJ/QjiOUWI\nnvQIJ9Lkw0Vlnnb23dgUiBaGSjnKYmndaXfwi88sJrTZLkT5mVB1hu/AU3F0\nCXcIVqEYgDgUtp74zNa/vkaEi7KF5TsnmyfF/f41c9YMBX5RldgFHolrm8wk\nG+DBFh2jOi+P0EJYMR5uoyASEZCgbchQHWD2AXBkrqOYkqSNufssveCXBl4N\nDg7j9G0gm4IwViDQQKJQqhZqySmGs8RwPLWZtzMzYjlgsWvVc+0i1LhSkNb8\n7lMQhgpLkr6VL+6nlkd9/vcSynnsDeTaN92pJhCOKOVp3YbCKQe+6ay7S9mm\naDuROVdk6fAYGg1EmGNB98qT0D/pS146ilfc3EwJCjUUJUQv1EaI2VhbwnIL\nLYMbKS7G7aV6dvNsn3HNfui1gBxtjEwZy3s0nNe9uAh6uVeinqVFMkCybIad\niaaHOWPR7mYBCf1xDq4K0XWcG+7fLjIOhqQE0CzpWuev6HlCms3GYiUeSwst\nrFpg7CUxUPzimPz4t+K+4rvYtjbnbhw37w969NlgQo1CCH6dw9iRSG5i7oXq\n6Sx2\r\n=cMHj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"3a592e28dfb9ad1dca34cb16a013f02dc8fcfc74","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.8"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.8_1642686394169_0.7170400868988209","host":"s3://npm-registry-packages"}},"0.14.9-beta.3522":{"name":"piral-pwa","version":"0.14.9-beta.3522","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.9-beta.3522","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9ceec2c38699993b298b666e7b5b8ce4c6abc8c0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.9-beta.3522.tgz","fileCount":40,"integrity":"sha512-FYTMrGMFHYUzyu8Jvnvb4SR/+jRu7/WEtk0E4dmHQ4vKUTDlJIdGz18tCp/366ANRaqFLmaJ4URpfT22ju9VsA==","signatures":[{"sig":"MEUCIQCNz+3Q7pJI0nKDTxuGk5W7FFU1D/+NyPGXjU25IiR5QQIgVd1tuzP9BE1yCLtzf1qO0rKtJyLeoNJYbJD7XUJev7s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6gWKCRA9TVsSAnZWagAAmesQAKFLUyY5dbZfS78Iqq2D\nEcQqcSNDh4Lx8UwyOnV5yRljni1qolySCdm5a8aoxxAd7G+H6Mslk/XLv+mg\ni8lkDa5sipBs/CfcgIBRNc/KPlleLOxZ8NfpAfCmQcGZgi5wXpwvaGhInMF6\nHUVa7iDka6jdwgDhvIdP/HTA2ug3BxmZLOFzyZcnZgq/2VIvUlzM6uxLlJS+\nIkDn1LNNqiP/9ENukSgVWU2eltWu60xSwCdcboEKzCpS6MrL//YcC1FIKvPH\nUm9RNcyzoo0o2HaXlQzjYbBOgHlpHCNlLAbr6t4Xityhly67Uj/KODNpubFj\nxF8iEzur3DNstzBF1DJUu5jrcRwTCSAMDgOFpL7NGfuTq7wJnUcuJQiK3WU8\n5chlRYtwCtY+WqjMZRJ4C1QdG+sK6FecxsaOJ/w5Ts7SqjN70wfTpuJdqdkR\nA+HCn2bOnrKeSAKIvUbxmqR4KshUFLD7PQQCQJt4xY8CPm//ULaVrUOPam2S\nBbOnsq69xYO3YTDGdsPwenrX4Z6+BY/IKY2z3fV40cT+N/iQIwRkuS8/egpr\nRYB7GADwIP2TMVQYTjlS5cEJgvXXYwMgUO/9EwRywi0DGCeKkb2l1ZIldl9l\n9XxN5yJhU0kZbKWq9FMZFWUplANlxDlGy134MtuxhO/QaEAt6eM/sL0BGDaE\nt9T5\r\n=5Q1M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e7f2966e6648eb5cf517f295674785c3f90621cb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.9-beta.3522"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.9-beta.3522_1642726794324_0.9272404721037695","host":"s3://npm-registry-packages"}},"0.14.9-beta.3526":{"name":"piral-pwa","version":"0.14.9-beta.3526","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.9-beta.3526","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b9355fa46b4ba76ac7e1429c1e1dfb191821004f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.9-beta.3526.tgz","fileCount":40,"integrity":"sha512-Q7SCHrV8BXnMDAIfwb7fKr7VXWlTsQ/Xo2amPJcGSqY3XK2XQJpMQEzgwbBcovZ/NCJIYPiwaSRdIjVddKlBBQ==","signatures":[{"sig":"MEYCIQDeCzcIEBCOBBcm1WWuEJ/a8gIYZhNAPpiknGSgijNNMQIhAMF5KZhWbcUIg0gvzPYlfb/TR7xo9Cy8SdNmE3yqjTnm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6pJqCRA9TVsSAnZWagAACF0P+gKCLagJVccE6dc2Yko0\nDGZcXSyWwnk+aQnjFona3MEYfs2LYD60T37/OOfH5iPOKkC5HD9JRtbXaC0f\nobZ7tnsWz3j+YX9H0t/DooQKDnctisE+572/XrOJRaCXTqOmKORzhafdrfYu\nb+j3iJE3QZP34tbfDNH1TVd3XuCk6wHRSf8uczcgCJiRFsA6x6d741U1IFUg\neIzCEMDkcrVVX3+7c9slyTX8DpeG1RSVbMcwfnfHRyboHQLOUCe1WgEEHi/x\nn9YKkG4s8H/VbHmnbGeZM9bR5R4KMk16rDb130b3fXIjiirrc4reGoDyvxIU\n9FittGiIg6MwXKZP0IAMTtc+l9AJm/TeYzU13AQXnmIuU09vxCgTl7Hmpn26\n0rkDrLkDvutooTIP2u8UokMqOG9niLixzl54MKc7uD2XXGW3yktO8SPn3INp\nJTE3wOmT0RqPDMXrHbC+W+9iwVMyeqbBeua0lyMO/0Z1FYPDc6lQA9ZGS1s5\nBS6haJPf+05+NRPSdMVdb3sgQP/NxvuNfH5OqihKOYglV1Z89U4SHbMmi102\n9JYFcFLiTNUQy1to0PsyiNoDOn+ubr9IT34ep9NRWUHGyRHz4KFQUC5Up7n4\nIEuFbNnZLoZ6gwL7eLJbNnVRf2uYosXuMaHJ+3FjMz1H/isFICTvmBYocW+X\ntxn7\r\n=/xPe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"934210d4f9261d9ec158922b540a6099900beeb4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.9-beta.3526"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.9-beta.3526_1642762858283_0.9027422104513412","host":"s3://npm-registry-packages"}},"0.14.9":{"name":"piral-pwa","version":"0.14.9","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fcf26dfc9e4605b6285c8c54e8fc6c4fd9856247","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.9.tgz","fileCount":40,"integrity":"sha512-wC8p2dwvwtG7G4iciYGYCqO4wCYo5YOFjqEGAmg9YMyxAVMx91liYP2qxVNiG7G1/8DEWLkJYtT2JzlEhLM7aw==","signatures":[{"sig":"MEYCIQCDh9VPwD1rm81ApJh0Jc5CwH1nYKlxu6rkA9CIaO3y5AIhAJUQJcdt9qOCdJMVei87Q19agYO/wpDD32AMkHXvxSz5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6pWvCRA9TVsSAnZWagAAbDMQAJtEJXQAR2Gxjw9Dp+h3\nuRd+wSl8wdL2y36l8FU6JUBcgZSkZg4BxpvRBqRxoeRa4hvaJQEbpuXXdgmb\nntwcLy4oMbpWSfxNkzoL5wSHehE4YJ1m3Kwebl3OtFzLgeQg8m8RciADtcTi\nS5tmhu+MuFZM8lylgMZzs8NouFmFDsQvYKggWbH5ZlTagHEvAU5Up5gmCSGE\n77BLRxPpFUpLWI2zwiMdlMcHDUo07dXgIeNeFMsIXpH0JqBKbcOa6QOO4A7w\nxtJaiXSan7TsWRYuCFmXh0KDPdO58s2KDXAQujV1uInlqzc+kv1DMU9Ct380\nZDk5XkVTmO2te0sU3YGAq66OzCHm7vl4CtNBc/b7749fq/rSlJa1wmzMAaav\nlUJ8FYrrAsAtA5W7AlLHnqkaG2/Q1WMZYOACocBTD/v+HOCIpAM7RPaiWuEE\nxbXij4ciLKmA3UWjAp6zE3cztq9X3bGEMa8EhzGBzomuCfJlgxGoxrjFMt2h\n4fAF3dNyj3evmL/mxh9u34W+hdEgBgJI3NhFbS3rh4RF1O7z/GIh5UBkNcVF\n9LaFy1WUx6FoqurAoWV/Rd6cJ5TzxBMcj0EkvfBe7F0qemz75za++XKyhLpz\notxq7jRdLxgSTsRYYEXphH++8RvbCtJYQw+9IkVB+ZA+9l5F5pZT8RWj4JiR\njCdR\r\n=uCTE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"8c378ca7c8a55c1b1e23e7992c3875aaf311f29d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.9"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.9_1642763695609_0.06943920402448245","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3537":{"name":"piral-pwa","version":"0.15.0-alpha.3537","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3537","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"109d46758e8771348f3eddd8794ab1ada90dd16e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3537.tgz","fileCount":40,"integrity":"sha512-xciubGNoAN8l5rCJmpcuOO2M5N/2r0uTBf8/K964YsMNRXCn664/bIdkcYfRLB+NB5n5J2d6mOSd6smzxOihVw==","signatures":[{"sig":"MEUCIDjIBwdCGIqWlQagx9r7seVO+PmLWR5Zgbyl7iK1dqQAAiEAq8dxApZVeakMnWnaY7yuA+G98SZySblSeE0EK8vweAg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6ylQCRA9TVsSAnZWagAA0ZQP/0+9C+fo3B/KtaX/b1Er\n8XnofpFOVkH1m0klA9BaA0pZ4XZ7S4jil1xKIcu57d8VtypMDknfYt5/WGcK\npZZebqNz+BAh5amMGfS60WfBaBvbfAwbf64ssZnN9lqrdhpQDfmWSuLa2yTP\nDW51MHPQOy6m8hGqsxF+GzfgCTpb3cf+a8RHQTjCrAST/FbYQGqk06CvkvoN\nFZpGDu6gqi2uilUji6+m8r1ip8JgDcWJrwwwTjjgHQKcgUYwwBKeNUhbGGUF\ngtkVXbsOVyqYRXAft8YemLXO2Vmp8z0O592vL+J+n9bp45sv8l1y3tuiXPAL\nSMhgKtf+gEtyOC4owgx0DjAuea57Vf+1vuKB+7DWcGJiNkgtb+Hd4QP+TRT/\nxt5+/vWLkuA5F+898Fp2K8o3wC7RcXFJnZnTBGza7wKHjEsX31amHQXQHakt\n11V/WmUUYhWJdZnHjvZg49BGkttn/jMPiIkbc4NQhrnbH8oXgNkAa/rSfj6o\nDazkvaniyiKbTZeJuYk+t/YS82vK7YvAv690A97aPAvZJPyr0uIyc/x7ZAel\n3s+apOAPzBMkLIiTfsHW6lqMrQSuZVRmnH8VuRrycgY0ZU/TdFkgl9E7yBjQ\nMHFGJgZKG5Xu8k4m6VDXX9vW7d6dvuF5SMDCRBcFDNyTUjznywn186saI7Gb\nmZoa\r\n=hvk3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5da9d7fe4793668e956e96470aef95b41f2805d7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3537"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3537_1642801488307_0.268272101911458","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3540":{"name":"piral-pwa","version":"0.15.0-alpha.3540","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3540","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d395afb93a860803ffd6f0516d514b0505730eae","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3540.tgz","fileCount":40,"integrity":"sha512-vCzUBFjBq60NSVzratsf6jIzTaC64qdfTqKw2zSYIMY9UO5Z413XhLLUyKMlZUyhBfuv+wrBQpAs4KZhc6XKZw==","signatures":[{"sig":"MEYCIQCsWU7yYoJSfyMyUPn+tbgl69DU4LtKU2ugVapBvzOt6QIhAPUccVjmWXMWho6LCXsZv5M0p4mEEj1LjtITr+dJ6pSU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7B72CRA9TVsSAnZWagAAycMP/3NsJZ/jb8/VTS6NZ8Fo\nYSc1NwTyYvGLT2vVIofSBFD+YX+pnpd0h0tci0Ugl9bh/Gn7Hy4RCuf1HzAP\n0t0D18V9TnyS368LIAWmWBZMiDzED3xFGIS67kOfEZh3+wCKRBeW2hXIB66r\nGfe/EYIpMEeqBQzVur4GFh9TrKmKgbK33Ldtn6B68b/bnRmcvi/m26+BCECg\nK47nVfzWVGfQcxtqOl0np+RR3uwuV78lXpMWmOkPVhRghcardGSHqwxsRMck\nO8l/Fe2lWENpLxjDKyaN2KqMD6EiC58+nSW3pbgNHQeCxc5QzOVwARf9h6UF\n0W7JxlZihgrSeeW6IIEmT3DM0F/NNhib5s9L/KeFJGYMmEKuno5wp9BvAcZx\nGf08KImd6V9FE5O67zPc/A0AMWc6zT91epfMqru8IKjkgcCe7O5Q36c8hDW0\nGUFXbbCthaOFMt2lHlC8Xdo0JH9P9aHy+MXPRoE8UBOqgn61RtgO9dDRCmgV\nZ+/MVCSX732QYUxF2q8TPhB/ht8Dzgw5sDHyN/nWd81AI2r8QrmzXVvHzrk+\nSVFEXosnFDAkrEJvZdVdTemShDp9CLlrXKXvUlUYnQatjSJDHIuiAy5T53Kh\nvZvMzcWcungYEDxkPkmT8zOm39UQUv5jZB2Akwv1uDvbmy8n6sdyy6W/8rub\nRanq\r\n=nwmR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"151470c2e2e9f8616949acde653617fc0f6d1f8c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3540"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3540_1642864374816_0.06503344222482688","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3548":{"name":"piral-pwa","version":"0.15.0-alpha.3548","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3548","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3cbe84ca60b4c8b7ab3320b4435345036b001ef1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3548.tgz","fileCount":40,"integrity":"sha512-fWZBQJMmQODGy2lhabxm2VaOvxoXnq1W22NsAQHVKrvdj6Z4WyTb8CGnNdrzAg0ArCtuWKKI76H81zjQlgkqbQ==","signatures":[{"sig":"MEUCIQDzb0FsVUn+xvNazuHaUDWVdJBXG3ng3JxdBwaSF8A/ogIgea5Term++NVS5bTccMe4rxh+h7ISLM5E2EmLHuYCmHs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8FBYCRA9TVsSAnZWagAAneQP/1rx42BYMyjJS0MF7STa\n2iRAXa3i9vhIEARpXgi9Mnpmu0IjUwXBIT3UREuALVO98oqrgvia7bkbw4gr\nttp07uwNK6SNqAqvOeeq8rRACTDkPSLRkW/8Yabo229io+S9baDTaWVIm4UR\n7V+y689BLxFDLLOp7tG/QzLCYOegdTpop97BHVUbrnQ8KvfeKVlpunTW3MTQ\njX/v6+VfjZQcj9FT2pJ6JSdC5MBhT29z0PYeAOcrQcMCPyBpaafx/2s91uPv\n2x7JK2MRDyIjnFe9h7lEKynCX4mlc1XjnKlkUBkmW2SyHwTym9n8jP32w0h+\n7vaVbDU2xoaDQUzFGpa/iv+jZtPBi4moG0uqGG6znZ+WOnUUKuzTsaQWoERb\nGNcJpTHVdRM4/ftebMVyVJ+2Ieb/mJBo/3/SKJ9ZvChubN0vSwbEK+MQ1wIU\nXMn6XKeHW/70rkAiLk7ZVAIoR7Nu0tumqX2mIW1IxZvfIxOI/hnF2XOFjzaD\nOd2nq8UX472b8pXlPVrcalJyQkJyo92Vub3FAiKgDBYzSA36YfMnXyAcjnDw\nBRGg0uu70xxy4lRW39XMc8v8fUYjGQkRIu92TQsUEReC+DKlRQsRCz8vaXnm\n/S53IgowNYuiSau3VBkckK6ihb7PQ4lr1Fy6Q5u/NBN3TPDlBy889yM5lPWf\nFELz\r\n=8fpW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2edf7bbcee6a7e931348198d14139c7f958877e7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3548"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3548_1643139160347_0.36113759269134804","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3549":{"name":"piral-pwa","version":"0.15.0-alpha.3549","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3549","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e21548c2c4f12992b8ae731959d7fd8c899b656c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3549.tgz","fileCount":40,"integrity":"sha512-q1SOf9T50wlsS0jbV16sn1nE/4p56rPswICRiCp1MiJtwJ8FPoPOy6QaegwqdXW2SESg89wFxZGIKtCEYIuhOQ==","signatures":[{"sig":"MEYCIQDViyxTIWMQWegCePX2Krvhda3RqsuAz/yXI2R+SqPlKgIhAOaynDVcynSCjMF5EX/RfatxmPhWSKqq4bgo4mGcX4pO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8FTwCRA9TVsSAnZWagAALtcQAI/tQ5o43glHirWr56CR\nwuUGQ22ZzWFQvpziqXxcPV1I8lQBlvjMcimuF7vDin52NCG+nXfCOEBMnUEn\naaToBbo713NEM4iUwcxqRAinHUX+QfLYcMB/JnAexXiSCaVMwcK9gqa49ptE\n10qfro0G9b0+OAEwE4sHn/Ej46aAHJQTWqP4cmzW6hYwW1Ze6iN0edDU12zt\nBeNK0Pjd2sU6lbAWW4mfoTdHfdw/ssWkmi99RWn3nqgIY8QnnLt7WpJ5bDCL\nzCuChenDh03eu3/b1yAjEZLF4KUDlwG699LSucn0K/abIHumRvV88Wdfrd8D\n1LAvftgv4beFaKXgZuIYXi2CNgz1MOAyaHmeDK/pXPKewc4UzT+IFpYfy54G\nP5OOJEu2SPWwGrDkD0V0ndQMegrZxXjQqqwjNukkXOPwEo80uy9fyY8RzJGI\nx03XJ3KJNRnw6qPF2FHtme1/3stb9rfZs7RV2JMRwTXLmZulZU248IE+0L5v\nPwGlt85fY0VFxFfFVndUP/Zvq/OpWtyZZy6BBmLUet6BBH9PaHEfXz+B5CFy\nFA4G6kLonumSwqGm+3RjrWwO3JiGDan4aLITY3nSYh5OtFc75tKxXgfao+sm\n7wHNGAU//Lss+cupMZ40dhzeWJxygh4yxB/D2raFnwTNqaUjRanu21QHtnN5\n6vVY\r\n=OIv8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2edf7bbcee6a7e931348198d14139c7f958877e7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3549"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3549_1643140336281_0.10080894980285393","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3555":{"name":"piral-pwa","version":"0.15.0-alpha.3555","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3555","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3c2f735219f5faebc0a949f6cfff123eb3127757","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3555.tgz","fileCount":40,"integrity":"sha512-0jZ4qaPNbDlght7xFXptygXYbHygEPvT+3khura0om8DH1iGw/ay1qKISQ8hqT4QYAkxsbgh1dfCvc8QoNvFxw==","signatures":[{"sig":"MEYCIQDEi4jvMVlM5Q7TGaTu5HmGe9RLMhE6Y2SPkPd3oURdqAIhALh6ZG/35Go5NOHCDRmwsHsaannl3WoClSj7Pj8ndzg7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8fnpCRA9TVsSAnZWagAAeu8P/AgjDhje12JH9cjyzaea\nVQ+m36attCeu4XAkNYo0f2CFCHhqxNENTaydVHWR5PH7HF74fWKyy6CLCVBw\n0FWAwh4fLBij64k24g63QUZMVdGBDTvulpMTVHXbVka744W/ngZobZD+jNIM\nDWH4pafCUgEcO+TpsiC729bOIboFdM8PBdJgb5vQ5fDLRffPBxjpCwpuHVfR\nkjNmDG0nhVz+VgiArTt9PAHlE91Vv076mSwOITuaLHtdF2CmVEfN6rTaWiHH\nEQceFEWJ1y5nxEAcOpnYKjcuf/V6sVuOsPqTGCUb80+L18a6rYVsl8AIxAhR\neYaCIM8bPOx/HHiMKvYT3+dV9D6f++ngW7UGPAGeq5U/8s3FoSnF5ZiIONjX\nhO30Yk4X+FzlhdsBtslNkhsBFXO6yomO/U0R3q7dyusjZfBx/SbUNldaaK6t\nXHjxfIrAyWNDe5NdufqD+vnyR2yPDawlFdIDy2djZ8D+qSpMg8gsUtP/dbRP\nJlmT2QxFf72yde/hF3pozeyubhgI8V2fim0WJtf65ZsbIM44p73kMza73ew/\nY3eiit5bLeX9jlQuKXrTGJ/UvbSe0TsjVvR5S+4nlIh7nNSQpffEEELJKDdg\nVoYt+2TYdC69zZjl6AtQkzNMEcjUpgaEuXyzDQERMRLO6obmcOfsHR+VF2KL\nLhLG\r\n=8iNj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0727a5c782dd1bbc7ccaa11a036a9f16e616bf10","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3555"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3555_1643248105319_0.6249035734845685","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3564":{"name":"piral-pwa","version":"0.15.0-alpha.3564","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3564","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6333d1876781566c5cbe397646782de9fb62258e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3564.tgz","fileCount":40,"integrity":"sha512-CZDhc5ScQEZzB8jF4s+V/Ghc2QuT8I3SDBjfHxbjcCkRBJQrCGHRW19kZj7umhvwY3Skpmb/HdkKn346DHe+Xg==","signatures":[{"sig":"MEUCIQCuFrz57mSQEfC8YBBxtg4uUL3Ur1igBTya+ppeRfBeeQIgdq4eA2EJHKYJb/KsJnMJE8MEvdy27xEdqJEZhXas98A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh89LrCRA9TVsSAnZWagAAX4UP/39yfCxjrQtr6XNl0/BF\n1jf2tC3yXHO2hZc2H6zIqhh3jINs4dP0S2K3dGWutXkGDviQ8VBP43h6sEUb\n+cYb2x5iPmmZ7q6Pqnpe8zEWEyGYd3iwhivmRhR1+sChPDjZcp4aslSxMs9e\n12s6fnnlb0QVS/QM8akX1Q52F77D7caS2pRzdUVo1cGZqyNmYwKAuwknWCGm\nsol0Y1eoShd+tOuTl2iCjhv9XAEgU0/5vvKziyYs3B2tqbhxMazHECaB+XoN\nLJrIm4iDkMiEWQx0iDN5IMiWmZ3qOK11SIsTG7rLU9IYuZZNQNCag6icjNiz\nbUtDeqv7o61hBux4Wp/G6R3f6/JkzRN8gH4RWN1P0DGq0TEkssoVKGgcAs2V\nwPJFg/Xuq9x+wf2j1uVkTabcBk3DfIab1OQGN0dIW9SwDs1RUCeTrQ4Ejw8v\nCa/YCvGMEB7DXs0+Fj2Lcb4UAZSfUZ6JsFtqtxZuJvjzACjm3m/h4pRokfze\n+RBSGyog0ay/CbgyBRp6LElfCKLGDmedoAgq5J30GawHcAUCs1HxEuLfpfHf\nWHVmcMInBI9V7OVDtEddDb6rZ0uom6BkTWYZfu8qDWfWvFnQcT3apD3m4gss\nYGZIVQ8iA2rXRv2Lvlo326OJ6lILCR9dRGMhdcrJ8Ey9+8rvw9zoI7M+taUf\npTlm\r\n=s4Oy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e5af009799d073993a1c415c4ee63029f9b3d547","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3564"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3564_1643369195524_0.6380338881274237","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3589":{"name":"piral-pwa","version":"0.15.0-alpha.3589","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3589","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c3790fdc1907702bd60a4d498d40905b115a64c1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3589.tgz","fileCount":40,"integrity":"sha512-glBG1Z9sk6GxZDh2H+6FDBTZWCtXAINCczFT+4UOREo/h7LKKRvEC/D1WpQdGs5hCV5WHW5OGprH31+eA6Qzpg==","signatures":[{"sig":"MEYCIQDyxGX3LWJHtfrPVMEdSDIXQPu35YD88qkhTR02EomNEwIhAMf1b7o1fCNiThG512vYwR9QVreJr8519kjUqH8Ehxmq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+sd5CRA9TVsSAnZWagAAYTgP/j1FQCAv/c53QkG1aWS1\nTDQUC8C+s44bfyWo6a6HOFt5pRh4ESUUVfnlZ8i5maYtIWHT4z3VwuerB/nn\nBWfSx0NPxhSs48DzJsGE6sNb0M1jTReWGQWy1EUpfomeQU2ZNZDEVcc+XtLD\nOHzuQMm4U4JqyVqAGOdwupYLmJJDrci+9eY+pPRgvJ7xLwvFfXjhBx3BoGIv\nlDoGcwyTlAHtOw7WwTLffxZ7O1bQpRc1/nVPjomSAc9p9Idwfkd+lKDnerol\nLfzqpVsNhXOCN2/Pz+Kec5FWBlO+TPdGtBBPz2ZEZKOlQvvWMWZE/+U/6DIp\nv4/2sJpI93hP3EuDPnwvTbfoLGdd+JTcsT0DUNEYWOzRlFMnsUp6SkMP0ZFW\nBIuU9Qdq+wjS4CXRv3jtDAyPzNvNigRjqrXhDr89gvY2ycsXZ/rrcAe0CVNU\nDEY26cs+x5+itZEi3rwspRgkqLH47mfnxcAskEUHu/g7PGZdYvVBA5BCRX75\nkQfJROxiQVZA7uwBO/ggOocY+82g07NAm+2jpNQc2FRNZ1wv/TFPDFb1Uh2J\nZO/kibQLevOcVNXVdoK5Ejo6Nv0+rH2aio5yZk9vslDm74+nFGzWe2tJHQTH\nd0n8wbRAEEjZxpNOYu8C9KsnqAJsY2V4PNS5vyVlNQJLWhZjGrxVIoqR4TQ8\n3fbZ\r\n=x+pu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3de80e7857d8f95c5f7c6944dfad56d4a5e21f8d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3589"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3589_1643825017564_0.13965698953380112","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3592":{"name":"piral-pwa","version":"0.15.0-alpha.3592","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3592","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"caa2a648f07336463d8c8683b0180e228c28cf7d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3592.tgz","fileCount":40,"integrity":"sha512-oMbTqvOpOaUoSM6CCQ9kz2zY8uo541YHTML+8TWUyxxgRoPqwkDedWVDxLrgKZ4Wx49bLO+VdItta9zPZya/rA==","signatures":[{"sig":"MEUCIBhD+mCdadMJ2c5sOIBkZe3N3s1spJY6728n8YALrWBTAiEA0Sh29HxOjZnSQMtuuxRQLq7oqON19A1T0zgZ6hbP2Ng=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+y0OCRA9TVsSAnZWagAAw8sP/0lo27aPpY9oMTGh+6M+\n9pMsd1AnJqcFuCUXPSjhlCL3j0qLJ1b8yNJYF5iK7vJqizO17RgIHJoZJZ1Z\ngvPluZU28Jc/iEDsre+PFix1HoVKRrNVGF8zkSMoAVsL8hJrTwoEaGuXP3li\n0KNxXdlt3zYcWkj7Y6vWU8BYI5OIYPXl/eH6zYFi02LJvSu9NpYYinE/iJ7Y\nBuZIFEEoN8a/9XTX6zK0ZNxEkJQZvgGqOJm9JPw816E3nIJoap+osTAYdMc0\na5XcMz8Yd0rdbW1JpAlXJmQQvRKfAxwfPm11SqCXHaqrQB9TuFAGyXhQbh9o\nfExuy7EOZreo+G/eUckw3E/uVni7edB/XyPYYiFkQ4ud3voNj0dgaaJmeFGf\nkyZeDtEGpNoNCFmdD5M0Y4IsbpXq/043WDtweuueeNjM8BOUSYk8UyJLI5a/\njcxok6fESTA8QwyVA/K4TpTQaMj8DijmN7cKs1hAik3BfdGAu6HJr97Cpim0\nYjr216BX8Hp7B9gV/SJUxPqlbw3DU6TcXKd80QKWP6Gqx67lLknkgCF77Hig\ne82UV55UKy9tVWhm7tKEJMAn0it6/JCPnsWYiKmNOTiaWz9aNf6Bj/4MmNpZ\n9qh65xLIbuk87Y/uGYtzCZ3QR/oNgFI8KauIM0LTiqe/R3tYFHuNPfUmpHIK\n3Ild\r\n=hklZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5537ccd39d275afdc53845ab8cb4868a8dbc8903","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3592"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3592_1643851022240_0.201507328407607","host":"s3://npm-registry-packages"}},"0.14.10-beta.3615":{"name":"piral-pwa","version":"0.14.10-beta.3615","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.10-beta.3615","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5398aaec51b2e6953a5c4b47aa7ad7fe52e7e1a8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.10-beta.3615.tgz","fileCount":40,"integrity":"sha512-wLnyVhi86nvuIf/i9qIE3xm2i16+oE+x2Fcw84ko6ZZsqkmy7URQW2ibKzRv/VME2aihqqlW1XNdo/+tf3ed3A==","signatures":[{"sig":"MEQCID0j3SdpKcXG3z8UgHZszfmfOHiPXZpZSplVTZmhTTQzAiAKaACUUHgmWTVkWesXmQUDMrfI4rQGVaXot9fF3uEAcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/SwUCRA9TVsSAnZWagAAzRgP/10N4mrXxL8kcr8VXYme\nUmP3mant6Wb47HO8HkJtsBGsiL7eRe9hSpq2zv4txF+FRn67+Dc4ew2HuSL3\nXFlcrlKc0fGUrOfelVFligsETI8mJH+m0M41YvY/Lrrh+QOF7Rg+pbdk94rX\nMSR0nzdILAyaeFgrn4mdWWH2Ov5BN/OHvbKvqF3dwYXuc0j885KNLFkeEBZA\nd3Pg5Ft72xeVxCMi84WJexdmi2i8FUrItu0i8Bxxd71pjg5dvZyAEJwN3CzU\nPLx1aqZPXdSWO+jgInupr+fvXnhdUTb0QcXQXaT9AufqNWczoZp63W5dIU2V\nfbedEfT8Y9GgZe5PhbcHt8WP4MnlxhIBPljxTcwROEVszk2BVLJyeeavFHwz\nd/ZNmtsdL1ugIopGz2aY9PaMnMO4oGtqbWIB+2z3NRNbeOPKq569PqBorx0e\nm8ZdrndLyLFB7pFzDlBhIWnEvLy5iLrHvIhBnCfA1IUA3S331/sAxtfqsO9o\n8OuP1sfVn0BDTyAlYYZBA7viO526+yuOL987LhS+buK2uOA7w9AGCcPES0/n\nqU1a4Z5Bpi6SPVEp189n/TJcnWbZM0RL+CP1tqkxhQhpVfaVcPflXQ3w6fmg\nEiNsPZ2qhpCagoMS5qH3rtHUnT9RWsLlg61L4oyOvD/CNwjes8sbsdjk6w4/\naogj\r\n=bCAx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"57d7688876ae35920a429d1580136d5f18c1d085","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3615"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.10-beta.3615_1643981844714_0.23882998454943527","host":"s3://npm-registry-packages"}},"0.14.10-beta.3616":{"name":"piral-pwa","version":"0.14.10-beta.3616","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.10-beta.3616","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d67632c642c24ff0576b10417dc9f837971799e0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.10-beta.3616.tgz","fileCount":40,"integrity":"sha512-d9wSjW69SidjBlAEJUoeMuWtBdl8UL0O7Z5ARXu/vU/2O5w5DXfhQQ0mU3ooSl8ujDMxtb8Nh7HB7c9Nw/Lpcg==","signatures":[{"sig":"MEYCIQDozK3CS4hqIpCFvZvw7V5Qea3xoq0VeD84cTBEck9CqwIhAMSbNubUqfQu9DbI+SimE7lXMvQ6c9luVZiNwUnjJRSx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/S0iCRA9TVsSAnZWagAAO7AQAIwfcFgz7nGUmplGJsKq\n676nHmlshZ4NCQzT0lHYZ2JDZ0PymTu1BjvAytUQyERv8Mc5dAyKLcav16Cu\nyljFXeR3RED3QYy5WrANjbANOSgtLjJali85OoVICTy07I7K5Y/buhz5UF0m\nz7dOxzq00vCHa39j/qdN/bbDDNcQ6m8VoC+RKGoysG/pqOsFCf0uK98oes6k\nPFmarXv1fp9jisOa9CLNPqubrpdY0AklYPger0mQNczD7T5NQo5QTGQ/oIVF\ny6NN1Blh/BGe/qgA7k4pcEQlXRxGQW6hb0BSk739bM6XSb1B9OCT7N3mA8e7\nAs7Rpf7iLnrBewV0g7cWMt3+8s4VlEYNSH3OY9zuXspLny6u61gnOMxfIQEo\nrrB60ypl9XmPIV8AaN5UGBd+RZXAwVISAzJdEtZmYBWH6HWvkekhhowri/7j\nJcjzk1sTV/hkHbxMsnnRPu5O9Zw9qRn/fQfqrlxyRvc1N+R0oLTPrrrGjHeN\nOkkJo2Gmk7cFdZnqeO3LbPPsIs2uosS7JzgFOsCleAIs5CzorgOaex9frQib\n1QOuHoWrsOHWtZLc9a0kOo2hIFWff37UFbJFSOVBOKoIDXVpyqHGEeB9wgLu\n8b7dCzbDtk+yQKm3FzNZ0BAtXlT0GwOo5tYmc98bI6rl2FM6noeBHgXsy4Vv\nnqma\r\n=9Oj1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"57d7688876ae35920a429d1580136d5f18c1d085","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3616"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.10-beta.3616_1643982114052_0.3050764648215589","host":"s3://npm-registry-packages"}},"0.14.10-beta.3621":{"name":"piral-pwa","version":"0.14.10-beta.3621","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.10-beta.3621","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e5563d782c6c5891f72d839750768593d719e589","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.10-beta.3621.tgz","fileCount":40,"integrity":"sha512-aXK14Srdjv13uJfp42sXApnQxl8tWJQJ9uuUa5wegOcwkNz8DndYOHXdASHPJal14cmQ8IKoKGysjaOqOdWv7g==","signatures":[{"sig":"MEUCIQD7qd3gJQnVWsh1oIFUJGKeP1MhpVX58LnqSy3vYfOPOwIgHebwoZp35hYqhwIKGPvMm3QF1RWIjxkDaH/HQD/OTdk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/W9UCRA9TVsSAnZWagAAPL4P/A5SRSb5pEADmunnad1x\nCc8g2Dili5t1GU7Q2Xxg5VsDeiGbb7Hm3cI/2/nNQpEIx3HuLXdh7SnKD/Br\n1BmZUGskFpxnjqhy9a9Y5mxwU3fN1ZFoiZum5xnpx/bj0UB8xjyPIHc9Taap\ntL6Lw5pWDi95AMPPZw1UN3nOq3BOWaVvdyTNJZFgjNQvvL61PTf6sYh9Lj/Q\n6pEgDplSYEcxEIdOWduOEdEpmr57zNSDHjXCLkXLV2ljIQuSFjGp0cl0EYIm\nhpJuvNa3A54b7ceyNfAIM+T3yReP9RyZfunD37pe8QeKiLIAF7y8AnRqTsdH\nZEvqGcE4+et2hd6tw1vmtUDuqxpvybLoG4YT3M0MK1mnP0bOQFwrUfmOslY/\nBdZkprS16zi2cwBV9azKqoVtktajwUQLcNi7yT+aniQnkk67px8P7GfcQCm0\nt7TmgwXlCKhiWMDXpVJQzK27e4J4zkfYeOGrJCGBKMLLpY2n6k8KY7hy9PzH\nj0wMdyqxCGbie6ULrrHiPVQa7tc2r7DxkE2gSsGXE5hhMYIQ+h9O5b7ZJ7hx\nJSM9rwSbf8U5KRFy0aejm9eCG9p1TGDobYS06E4hCIWFOZVc7L5jaTgB8Wn6\nfR/Mm8tN0yE5w64us786EV/dPei6OerHZlYI7/Q4QLKPIqmY+3fFI4JpLdZQ\nnjoX\r\n=vZCb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"161b6a945b0044bf356475aea053f436c0cfb89c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3621"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.10-beta.3621_1643999060677_0.10865736112214641","host":"s3://npm-registry-packages"}},"0.14.10":{"name":"piral-pwa","version":"0.14.10","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.10","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f2cfc52bf46fd888c3cb4ddccb6cfacbd115cc98","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.10.tgz","fileCount":40,"integrity":"sha512-k6aX2H/P3mh6qD5jlvTe5Froy26HojrCMdFuDfggJXUdmIMrrRvppt118MqGWBxFdBmGYLPSPLVRx5Jdpo3K5A==","signatures":[{"sig":"MEUCICMPLjgCrHB2VLuV7GT1xbiDqe5pqvL2yePEeZbGrL9yAiEA3DLPwMT6IePSXtn8rykmgKGfHliYwwtQKHHmNRUvi1o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/Z7KCRA9TVsSAnZWagAAG28P/3cH5VbMiT2BVPtcE43g\nR2FhZa5WEGH3kpNAQXoODrvfLJZl+s9AWvzIneg31boRgJbl9Xkp/9+2woqa\n2Zl2nJDQ4lXBu0rDK+6rPP9ETNm9930IUHrOcJbf6+e+HCbWHCIOUyP+qHge\nx4/XqPECKax3l1ekCKrF8GhlrR/78qbNL7u9loHH45CTXdKLrYO96tXQnzgN\nRoqVLZSW/tPSo0o6FlzMYXk8FHbXpxv1euQLseUSdH79rXcaO18OI6X5V9Lt\nVD/reLvwJWFIkoZ9x8svKTp1Nq2JVAboH9SToGt/OjDH5kiU7j47c5THvtsG\na8MDuuqq8LxT5YFFdT/9zVwerQ1RCAG3ZfNMtMK1mFXVCJc4BPrGrBgOY52Z\nZsuTXknBNyGdPloNsaTZhRlKc1rCAdeZ7CQCa0TguMFMz8kDfZbAllHssogL\nYcr8dxCSZhQo9c8JNSbF5ZhNNhRgLcQlVGTute1wz3AT8eRVXBMa1ITRA0Y6\nvhHFfNNzRVoCHbw0tUPw29SjXHEZCfO3hxOe5ZXsOG97dLiGHROQsyNC6+6U\n67C7CwKooNdLcrF95XjHdWM36KGXgBqErhjlyWn23CqnqVg4adXfAhz8EvvH\nMSqftXq5fpwJMtMzXsOU4Sb+vMm1cDia+aJW9Gd+/qEK3X/gscPjOLO8fp3C\neanO\r\n=PG15\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"6eed3712597b7162bafe5d12b77014333168b7ff","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.10"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.10_1644011210459_0.6309827196490088","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3640":{"name":"piral-pwa","version":"0.15.0-alpha.3640","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3640","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e2b88ce6e9ef6800e43bd411fe9dcf52ce583fb8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3640.tgz","fileCount":40,"integrity":"sha512-uHWgbvMzUdfRx8YTcDeI32TRCE5buZ4U9l8sPjHIVfTpdpmC4oHYeoPPNsynvVTY5l9iBWxcIKVJKb96TEVc6g==","signatures":[{"sig":"MEQCIAL032jSxaqsHdJvqMnPaKptiIAc8gLIOALNZ8Xw7Ad4AiAwF3+LQsmwxjxHQ7lOGpM/SCBoyNv8k8FCAQjNY4lsIg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBE1OCRA9TVsSAnZWagAAKGQQAKUsI9qjdMtDem6mOeCW\n+U8msVAhim/8twzSKU/y42lZGdI7HOcC0kjnus/Il3KCcR6fvX14/jEr9w8o\nNl8s4hucLvKbk17KG72LpByH867H6kYNmcWIvLPKsq7puZIT3/wnbfIHVvpe\ndUd4uZ0X1u6sdMGZM9WmY9SVsb625eSf8PWOwCYhm0WdduRIYfS8nWcoyyGd\nM6TBdwqNhdaJhlOZdgq3CF1CPzDOEY8196aNXGs/U2gEXReA4Smg/b5sg4VI\nIVyuU3ny8pSgfl7QdAUdv1UeD91WbVQKNdZetWyBI9n3oF7QOzHM1UhVgG94\nj+YC7ama701Sx4tsLtrIy2XpELQDhXzk2b8Ua4PaKjS3j5BRjfy0RtMZrbf+\nqy8JvrWnWF7jcLSYY3Fgfec9w4IpH2qUpFWiRao7gTwdDWn4KFpcX9AhGd0y\nqDlNxkqwmFPWuXjYIIvWt1i4hfsBfSwGNRZuinjFk5Z43BgYw75uOQN2g1A/\n8er7GOu2uOTb/FQ4PPR/+7KA/szc9540H41v7DlYSNA/9cpzC6LvsT/dHAJU\nn7m6H4fG4ps8N5Lfh6Obgg2Vk3RCoZ9IyAWMbxqrSp80paW33w5Rs2WZuL+/\nAmtXdf5G0ihKOJnogTuTmUmJL4WjPSJ7Zor2CYUg30gGzi1/FF0LXcMkUTyi\nKL05\r\n=kXMK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"29ee91f865f9ee42229e58a7804cba6ab5e9145b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3640"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3640_1644449102209_0.052653416412458354","host":"s3://npm-registry-packages"}},"0.14.10-beta.3659":{"name":"piral-pwa","version":"0.14.10-beta.3659","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.10-beta.3659","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"75d71fe333f1a7e87fef0b1bb814b56b4a2119fd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.10-beta.3659.tgz","fileCount":40,"integrity":"sha512-CR6oQvm61qm7iAREuuVPTm1JljTYYBJrQofpndOy9caxzD/2D8AWGnUC4FzO14sjoClfKHUgKS9QBCc3h2c4eQ==","signatures":[{"sig":"MEYCIQDsouObZAvGDLy4QpNcHgyH4WTpP8Fg6l2NXAsqClm0rQIhAJxWt14PpnyJFerag0QUseomUHAjg3tBFYCfWDdzx8Cb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCOFxCRA9TVsSAnZWagAAMwAQAI7d1e593EZ6uS60A1Ok\n4kqgevTdeEjYJzGDiT7D7dRN3fuNe8tFbCkK20gaM2rlLHiP9ZtF9nCjki6w\nwHEqcLngvrIf8xhGNOFR3jsM0yjbgsLmTKgQXzN635VPuoS5AfkuYTu1rX/S\nojziTwp3uR9nM7wcJrZmlmE0zUoYeViAAJVc9pKux54BX/bAYHndBDjhAfGp\npgSjOI2dTbNg/Mikh6K+5vRef8GFl0i63EVE1M8dJcgKBKoty0cA9HxOW3Sl\nGADYs0jm4hBtq6CBuTJMngiPpQ4IJnxHGfvsfOYM4W+bqZsmy4+FAlT6m9oM\nnabJpzK8PtdsD3GWuuBsC3V/FHkXZFc01bVsGWeqg/M3uNsZy8GGszfX/vfT\nLLgpk4h6ZB5p8741/UiDV8D+SNWL/BWY62aohBUpnsxi/fl8q6YR9BjcI+hb\nq4/RlSimOlR0/CaRiiMqP0KpDyuC9XbEtpSlG4QqH1fpcpVfI8EpQSNRFtdZ\n6DlF99k3wv0PyB5eZFi8hmL5RBLS9xdEnrJoY/mXPBPU1nnKF73h7pfwn5t3\n5aDhcnP5UVlrSfa1mEvwpG+VOreKJcgFQyntjzP9dkzWp5ZgP7O/OEBgsXl9\n0jU/7/U/B7OvlpCtxxZnMhRXSAgnIrNwF1SoUWCczfJoEU5oLFI0QMiuv2YA\npMXr\r\n=Rf6w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"6ba6fa4e5956746899b81046ee25ab8bb36520e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3659"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.10-beta.3659_1644749169359_0.5752743129824744","host":"s3://npm-registry-packages"}},"0.14.10-beta.3661":{"name":"piral-pwa","version":"0.14.10-beta.3661","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.10-beta.3661","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ede769057cf439cc8d984a6cfe714d83a8e4c28a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.10-beta.3661.tgz","fileCount":40,"integrity":"sha512-ZZMk7gQuS2kZSeMm3qzV414cnsIuBEO3qras7wgBLnf4gPqTOZjk54odUzJ69ZWO5HvPlnMvXuvophojbZCxsw==","signatures":[{"sig":"MEUCIQCLzBBKNXF7JNXjMlm7fx0u9MfCY59tJPFNXIpVicS3MgIgP9P/xfoBZAAX3haZmwIho2l705VFAzZQuAbvwlM3oE4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCOTGCRA9TVsSAnZWagAAK/IP/1Bb5B31yUG+xvDCyzV7\nw3R0p0zYFbiabrcJBVyqvYuGhFkYoGqo4bjh530IA1AGpeJO345u155148WH\nB51U0XIOv3SDINUf3lP82liasQnfmYPKpVExMwZJOlOh3n+9Z3/ya/w/77Li\n8qYp5RFtyHpmKmoZRx36jCHP4HTtA1VldArjWxw9tnsu4h2SFG4uyd5oX8W9\nDDLl5RTA6y2KWI1AauR6Exddoq5DIUkJF013EWIPvqPOwYQP8DnzWydilPiX\nBpJSYNBczu5jeEnjf9poZ5kY2H4jaG05W7be+6mTe3oCg0O9wQQDjWXaLDBz\nI8PLtW+zBWw2IYns02BxXv4TWlazmbcEmpBZWo30VEX/Axz2J6wZVqVSyDvp\nQAN8lDThVgV0gib/GP5tsQbg1ov7kklpeeQR7Cdtks6/wLuF67pPjK8lXADS\nFLCFUzcyr+teINlZOS9pxWqmOJ6bLHfW0sK8td6LG4cwGjpknCgaZuQNHLC6\nASm9CbJLOOWXOmxqNJAgB6XOdX/kvo7Fp2Ua5v96ksIdfKfP9XHq/kQ1Ltr9\nJj2jDnl5o7eREW6f+bbDQp4DmwR9jFDImFpu55ThCu3O2vgVkl0Rp8xVX6tr\nVnW4IWCYKjhzeBTHnzXrNrg7K/v2MNfV+0pPSJFB8v93QrEroq+DNFqsnn1N\nYMqf\r\n=SNjO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"6ba6fa4e5956746899b81046ee25ab8bb36520e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.10-beta.3661"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.10-beta.3661_1644750022105_0.48144372694336623","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3662":{"name":"piral-pwa","version":"0.15.0-alpha.3662","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3662","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bb6d5b4e87c1d0743c29d0ed00eb933cc3b512f2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3662.tgz","fileCount":40,"integrity":"sha512-X5EOzu1WyUndG2Fz0vu3Ysy4A5+vgSjsOixss0MAUAVsLf/ncbojDO2+VWkO5wu43NvsmQasAmImHTXkiSXpCA==","signatures":[{"sig":"MEUCIQDD8y9PGV5PXacoPtqUsdFRbACisX+Nb1RorPZ8Te0n5wIgcZYdG00ohuHUp2Yh/h1kJomIU0eSL+mEi15sciYAvpo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCOp9CRA9TVsSAnZWagAA6FIP/jrzTkwNZal0TDrC0T98\nXlSRTLGKav09D4W0wDCPW/5HdjhkuCu4pONdsPK4xSlpifoYEznxA4tKnvye\nWSZCKltq2bySu1D+evwq9aHelLg5qdN1zpGcgAS/926zEAyYJvMDdOOYmEJb\nM1AOjDug2vTQALemJzkbVL4wVAIvqJIEi8c9LoNCA13gSuO0RNZOlcJAkm24\nJFPEMGqd7+EwzwvLz0jGbh9aYkAHY2beOhlMg3UuwjzufH568ZFlkOvGN5my\nL28kMb6wzk77O4Oy4psxN1uqceBhrXAK2nFzMW1q7Vz+Wd5kKa5X2Sd3VBwM\nLUzs9dwHT8ynCpsWHVvjmMufHlvSOA6CyVWPE5xR+sHEEhmue/PT9cSpKhZ8\nu2nN7gbnDBDjP+35yAmmXu/fUfjf60Yh4t6RHLqUlVEAuRACG1BwnG5cC2E4\nu5EIiSVWv0NqiEEQ7t5StOUEcP0eLgMlNyXGeRQNHoJGAwkQ3SIlyHCpJcPB\n2QjU5a+XutunYUvplLGzKmgQ4F96MMrebB34gcStdeq6IGLi7v5M2L5o9Z0M\nCMIC5Ai5FpHXNvqcp3qBM62xF8ZWebmgV7k+8BbDcsKVLa9ci+7S+bTp0y1c\nLIvzm5zKDh3l2/aSxFnBA3dr2fRqIMzcpAW5nWpEzgaqRQGmSQ5JAP9BALEc\nhcG4\r\n=bAMD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b7ec6c01e99557f270b2558a7cb23bec8e6ce0da","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3662"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3662_1644751485678_0.17580247119290027","host":"s3://npm-registry-packages"}},"0.14.11-beta.3674":{"name":"piral-pwa","version":"0.14.11-beta.3674","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.11-beta.3674","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"adb2e8a9008a45fcd0fc660ac168b81587e69611","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.11-beta.3674.tgz","fileCount":40,"integrity":"sha512-iQO0RbPkzY0EZ5/GZG1+nxwytZUwaIpxnmTbcHAao8opACc9P7toTgLSvpbsnT0y1kmmesR6XpdreDAyNsnkiA==","signatures":[{"sig":"MEUCIH7kdCMZ3NtJpOMu40b0SsUbzgZOVcNJY2e3OPvRZsWWAiEA6qQgH97Owz5tJlkdy0xvTPXY2DieJsabLmqGJH45slM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDjBsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpuXQ//W4cxoSjezVwyTkE9AB5RyqjEaiwbl8XKRKLqqdhsiVroMMf2\r\nheXERWLv0tv8LuI9t9nGXtOz1b5j4yq74SK/B3OazhkwiMLJychtlGs1uMS+\r\nF9mUIyR/5rXtAuhpCA5Tq+3tm4YXNCOv+ivXUDh3SpcN1HV6Ovwz+G/Jd+Eh\r\niNcGKVjJwy6iAphnrdN7eJpcFroicaB0FYN9ZKH049z4o3hB7GR+f5PWCnmu\r\nzHZL0G/ZDc3eFi4PPS4y596PhbY9RddLjf1BupWLVbpPFQM0Uxy7X2+LkKpm\r\nyUoNFmgqO6XIb0/ACPDocKtbLUrhUWrnKVcYFeluwQOpZU9l0X2zz9aeTDYj\r\nL+Bcf8SDwofOOHIi1AHWpCFW0ezqrJSDyrzMKV6bHRmiFnnfuEAeRXQM3BBp\r\n1xJKfuhwm5jzYG8o20uYENzV4s7bPAHi6zlXayp2yeqJgnvfJ/rZAlmz7iLs\r\nAM2MMZ8mqSZWNGNwRs4gqWAbaS5yDLbIFlNaeB9KdG5MUiDb4JMfvQzXV1gb\r\nNjDOcFrpMhveVXp3/FE6HyoD3IqeyeTteLovvBG1czHVS2OVfXkAb9Xk9DCH\r\nBOJnoBPp2WpNIkmEiTogALUJ7JLb2bkLIICXQ3KtMNAsY+UuuROpDjlyAZ2A\r\n+1/WEw4ps3kFkigO59iQB61uIjBeF7tlb1A=\r\n=vGlw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a33a388c8532a2a762bfbad62c5b5837cef7caff","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.11-beta.3674"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.11-beta.3674_1645097068604_0.6453989483543219","host":"s3://npm-registry-packages"}},"0.14.11-beta.3680":{"name":"piral-pwa","version":"0.14.11-beta.3680","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.11-beta.3680","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"aa1cd85435c35002bc4a8528ce3fbae6f2cd252d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.11-beta.3680.tgz","fileCount":40,"integrity":"sha512-+Pr1mmGin85umXFH7TtHT54O8ZilZPgBQkXJ/UwvEkXEwOTK/7SnnlT7tOSNGGfqMPETC5m3rnk44h1MFIC6OA==","signatures":[{"sig":"MEQCIB0PvLeZBQCTsn2px+rvH3UI02FnQSieIESqGHqHT222AiBcj2KQeYpbTljNRYOJpfjWG00Jf9GUDG8eGFCGbYusEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDlDWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrzIw/+JsGzmaMfPf8vLvzn29+cD9konMurBMEdZ4luoRIVwf96ugqC\r\nbiLu9OxG9ahcuCLVDhHxJ+OKDngKZ8nksWHC6GgaIz616lgIXlATGp/BU9ga\r\nFIJvClSFsjg/ArndJ3RTksvf/j1UANRA7JoVwqlVrcsCQLmFeO8s1SjLSSGr\r\nplEVBWNbT41UnXjjAr6f0LE2OAi/1evgRvT3iN89+aj1q0FJ8RvX38YZ3XXP\r\nXZU5Ift64bR27bxcyOLwiBpiEPpDseKOJ3Wlij65xE1/ogDoaCgpCVD09/UJ\r\n2CtFXODkZI+POsMit9usJiF7GrG6lmWceRXfwbDqvVC8WqvsdiEonnmZbHus\r\nHDVCvR/ThOGAokEdlrrFVFJVJZYb9uzNLcf5WDNK0bxCFcTlaljZvHaTkC0T\r\npEON5KAC7TKtJEF+EbZH9VlITPAmG3pGVQGGMrW07TV/WXrHRXM53AS5vVrg\r\npSWuHm3Xit/G1+OvtvsortAbALAHjlGinI9X1ijX1bZHPGFAZG9XnyCXVIwW\r\ngZqca0DDjS19VgAs/WptNJSMC3plqIV6LT/yY/0Gn00hde1NmpXHWarEOb2I\r\nGCqM2Xy+zclDIycHgTsXDXOU+4SphPG5BZV6N9xAARfkS3N+QSGAfH3YAfCc\r\nQbROPgNlUL0BOSo791hHlH4sHLl4ldxifY4=\r\n=gMHZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ee49adb6e617ced5f0d64a996c9f92a897451687","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.11-beta.3680"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.11-beta.3680_1645105366768_0.1321511350499991","host":"s3://npm-registry-packages"}},"0.14.11-beta.3683":{"name":"piral-pwa","version":"0.14.11-beta.3683","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.11-beta.3683","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"22d71466637fc18d957d248c2edc03894be3814a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.11-beta.3683.tgz","fileCount":40,"integrity":"sha512-pPITfFASk+0gLdt4eaGHyXCQ2GPhE+ANqs31jQc83NH6/tWKyF2IGGrg1YyLT+rAWtdwRJWhJzqDalkdSHUd+w==","signatures":[{"sig":"MEUCIQDIZivLVu/5KABqNIr3stisb+2er3G1n2/W+xu8vGcqsAIgQDkj0mEowKIRaHBnlYNk1y8kZLqnGR4+3tEEYtwG9xU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDmV8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoexQ//em5VJxKiY9TLFWqt794WvhnUpwMRaPuq/fi/8DwG1EUnFcZt\r\nKoaaScoUD31t493oaa/HKS8bLfZWN64rML5RkMWw4TXccrSXUzGM4HxLmnsC\r\nU3QgVTk/o3xeNLG0PdyvInCBqWG+jLLj4RJTR/VEnLHUHFLZ4yt8jKKQId1a\r\nJeXdL/1u4qsOiFH8tC4GeMPPdPnyhQDtu7eeCEHOXNa8vTE6yFEnvTekWb8D\r\nZQWy5jAxI0MnKngt2mGVIpt1jW+5U6X/OUlqFhTcnSUh5om3nmjJJdzrnzJb\r\nYfp4MzbeJGYO20I8fGNhY1d7slRnSnsvm5HJxgIs2OeA3HiEbPxFZG9SIwtF\r\n+bOjXXPrQdTZm8NvzY64N+2/ezZs7Mh1FJiL1z8flVGw6BjFg/nwAKjGCyYv\r\n2qzhwDOsclHmyhJFzJ4p6z4LolU39jJmfBjfajOVZcw78CoKcai8fUseG0X7\r\nnN4vLjVpO5hcMKpgMhZiyhgwfFPmXhizWfdfXShwhrF9UOc0KCEq/Ori8T4n\r\n+2b8L6AhT6aZ37d0oI7I6rqu8J9/HCJ/KvaWhgEhwIrbYz0K772gontD/+Dr\r\n7HQzY1duB/pcurQ2RQaXKSqIpEOD6/uhkIcCQfNdt6o8Pfvxdq0bw7xvDk7l\r\nIu1UQZsHLB5RIAmIF/RiZXplv8KCu9NWAyE=\r\n=4WDV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"175022bc5b565d8aa303a412bd72d75302a53223","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.11-beta.3683"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.11-beta.3683_1645110652199_0.2186107833577553","host":"s3://npm-registry-packages"}},"0.14.11-beta.3686":{"name":"piral-pwa","version":"0.14.11-beta.3686","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.11-beta.3686","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e5a5cdde198422370197456a15a1f1783c36492b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.11-beta.3686.tgz","fileCount":40,"integrity":"sha512-DaNUzmb9YDy/WnpxAs4/98Tgl9uEPUKk5ypi9tQ+yK+0iS5Ntys2+8b0D4FQDx9IPx865G5UJHtFj92E3L0p9w==","signatures":[{"sig":"MEUCIQC7CFSThZwisKxTWF1hmCqL+8o3hrb081N7twJSwMBa/wIgbw6HMUMTThX6WgpjcPVA5VYBE7tNdmxsEVYBFA5H/Z8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDmyoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXew/9FJK+yoXUvc7v3LizRtPMai8iDgRPkusvNaE/Qi7Vk6jLilwI\r\nOraa7hw8mji//vJsFnuRHAMBKEMI8Pzy+v/w7fkS57TVcYjj+jgQJs1nGrSU\r\nvjYBbbZ/f4B8byK9ZE1Ybo+gGzgA/gLbwDeGtkMEUFPnqgJg6ozBxRwNBSje\r\n8o6wWG2lCNL+Tgtzj3c1oR+CE7vwmaq0Ulu+G2YqAr7y6wBBzlmfgQq4ZblV\r\n/JruAbWAzaxl2n/qWaVlAWKrMOQRqQI6ym60ojJbH+Y32qgzsOw2n4Zr/fnf\r\n6AvfEB/MHHJOaM+tGyoKBlWrZ+MaS/SBdnBebjCjxsojeTqM7AASQllbsHKw\r\nAw6lN/zF2/1xCLvSO3u+8wE2+5SI+dzL++WBzSUOXL4sko9dro/fWYgngGL7\r\nwC57zW2G4ni3fVzJPa6+EgjSJj/PaUHJHC2MtLmffzje1CCja/DsbQvOYhHJ\r\nEThdv8j5zVlDHNYhyr0hFhRwAY4h6cSP39oV9y2BLYNszZRDYfEHB60gg8lW\r\nGuYpb1UaL+ibafHp02QvbYXE9myNgI0wyu9ZHY6eUpFUTAXHltJkG8IpBXpG\r\njUvP5m8d4j0K1K3xlZV+B5x8iRDZ8IrwRr3cZwOlWmPoyZ1Ud/K+79Y9m+TZ\r\nQSHdhqUTlF2GaapxFAK9O8co8fXvvOeGMoQ=\r\n=jcdf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"175022bc5b565d8aa303a412bd72d75302a53223","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.11-beta.3686"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.11-beta.3686_1645112488459_0.5134240060407811","host":"s3://npm-registry-packages"}},"0.14.11":{"name":"piral-pwa","version":"0.14.11","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.11","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e381330f6b76950d0cf8bf268212459ec7fc93d1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.11.tgz","fileCount":40,"integrity":"sha512-6FrtWd6Hp+eCM/boT9tqXRw4yktFA9k/VgTS4P6pEEuZZLHta1hGW9kpaHsGdg1ZoBqWfpOxLCyWqOYFkbhQAg==","signatures":[{"sig":"MEUCIH/TCK/+WRHdrw5IvP4gSWm5NPKCYE8xZtIemTT9LVdfAiEA75X0NJDQz0T4QteZYzXecmExrzoIE1BlJYUlu+r4HZQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDnnRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp44A//bXuTlngnu3RLgNX4hDwY8QKinydck2jHMQDONIBpaiElPc3k\r\nrDbh21m27gRW4wTYIeo4k1hH53at2jAaPWWSq3PiI4bK46p8s2E8o/NOHd93\r\nSkZUip+nb3wcjjWHaRfGqjS3+OuwV0rIF0T0ieqGBFiv0KWl89CxKHF9TV1w\r\ntHV8gNV2Jzn3LJd6daikymzUawHzGQqEictm5AIvb0NQlMRvv4IaHNiF+0AL\r\nh6JPwxONuS8f8c2RRfQssFIOffzxor9fzZB96iVNeGgRODlGvAw/hUcrtjTO\r\n2EnLsGjfs6v+CuA+x3Kn4uyKx3gPb6OPhMERq3CCkE9nma1B1BJ8+Hwf1uda\r\niPcWuUAH8EQPNWBXu37S1HzQtFdPKSVLJ5BUiXQLjvTCPgUnZVhHzN545y0h\r\nR3yGFahhCxKy6zthpbNePrGL8VXvHXA4kUdmc0DDnkyOXWf9A8jh1qQo0+5X\r\ny00lQmmlp7DhXwxnVbxXXfOh0yU8022qD0uY5KGi3uBhCyWSMISnZwYFm3M6\r\nHcEUZwQP4VOknZH0aGpPjOY6vJ2c78X8g6FnXdEVwHxzSw62jkGZV/Z3Yyzk\r\n70c7t/5gf0jXiO+Y5b4ySVDNuG0rVrgWc6pxqdcqsVpwlg/YFzK4JjFKqz9U\r\nViQkcMWFpjToVLMqVyd27zAUWG5f4ZQzknE=\r\n=XWdx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"487c320b01b51012dfbd1bbb519bae8bb0342042","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.11"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.11_1645115857375_0.34531103585346834","host":"s3://npm-registry-packages"}},"0.14.12-beta.3701":{"name":"piral-pwa","version":"0.14.12-beta.3701","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.12-beta.3701","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b749f6186a41a81684cab87018e84df7b33f6f36","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.12-beta.3701.tgz","fileCount":40,"integrity":"sha512-NyVU8QvDIa2DTaztGIVGO5mUhsxXK2o/0q97e3aSF6lPC3LiOwVYTzz8ZSQXx/q48jqgsKJkPFOKiDmZtMP/zA==","signatures":[{"sig":"MEYCIQDiiJuNYDabI1qJ7h0YxkKwSOZcOW630UwJN/NyUTtdSgIhANKkpVIjclPp6LW3y0/4LtLeTR0ReL8Gnn3X982BxdNt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEnPiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoqXhAAk/YZznv9Ecfn8rrt9tlzq1Cg8iR3sIht/0syLWkhxAk397ui\r\nMi9MfMTjDUv9Q9ueD3YdUaCIeYOQwJXAuL3ehKO7Vl3s4yeLieBWKzmriNri\r\nkr859xDx/bn5hKnnU/MiuDaZyYEqIU+u98+M1mvZS+I99al2CN0rqy8GKN0K\r\nTCW7dx16HO9ZaNMIobaPj/ZrafVl+NTX5S5qjJpY1dJOKvinrXqDbz4g8wfT\r\ntxpyzCJJZm8Fllf/5uJ63YbcIVBuauIIAUBkbX3u8/wapm8Kc1q07uHMYZy7\r\neLccvN+WG+SVAZeU/TdACoPfV0LxigzAAH6a+rTdGG/YFDhsrdomENMU3CgE\r\nPhV4SS/WkIyd8izqdzSj2ZsZq+q4u4mL0qe9xYp2nh5DwjrMTm+1n97N4rB+\r\nWnYKZx17/H1k/InA6JAgB9HhHUWR416jZH4bFpJqiEVJKf7CY+QZ1pJso/dB\r\nCHFOk7BUV3PW/3NnC1rOi17utRrL6T0lDk+PeDQ/zBODHt9zNSJftgemgffb\r\ndp0LenwZOJH0Fr2n7cPJ3lQK2S6ExB1vaBtXt/2jl8t+yxNMsfTAaW5F/wL9\r\nJkqy4Z0RKVtOFQos3g8BL+iTzIBl0/fcHv4922uJwODXaLUXkqJhjBglTbjp\r\nhNCmd80gwkDyL7rUAzNPVPMlkGbYsjfKG+s=\r\n=u5CG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a8fae0f967b40858bb9467972e17f9a8d3bc0572","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.12-beta.3701"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.12-beta.3701_1645376482546_0.8679688256832485","host":"s3://npm-registry-packages"}},"0.14.12-beta.3703":{"name":"piral-pwa","version":"0.14.12-beta.3703","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.12-beta.3703","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"99fcbb6c4e66bcf4b565fe46332f449ac5543fde","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.12-beta.3703.tgz","fileCount":40,"integrity":"sha512-G1DdHJ2bxFg62jDrDagIAbZ+kN30HYfmnvlS6QxQ5PfPzg+PSH2pojqnSBi+QZAYYVzb1ImD2D3gCG8AcZ3SEA==","signatures":[{"sig":"MEUCIDmPju9k+guz84HYQkE0BZqq+d5pRXywZxq2DDEpnCu5AiEAyCFDtLE9MDn2gzIHUt+hf71kjUEdgqbdwltw6q3eGEo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEpioACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJKg//UYcHe4yvEDHGX9TtA4MHv0f1i4XHBBsqsyhHnmxEQPqdvST7\r\naLYzWG4dZR80ZdIr4BVXPtgBayO232hndU0n3q2kZH+6gW9VKlTRmAesziah\r\njA+OVAsUqTY7yRmNQ2UGkdKtgq0sKz8sFYkb9rNbpIq54AV+qn1p43IPWyLE\r\n10GRamJzvXdL97Gb3clhDtRKpTwmdonVd75cle2MpIocKLrGX1aZ5OW+Wj9Z\r\nPuc2Uuy0Ta40fcbEGzkisi+41JUyLJyfvmcGNMtI8zys9WXhzSFLU+ntZVLS\r\n+/w11v+35y4FAVqOx/Y8J2OWeKQgLgqfGZ44x7j7T2FQYeVoOhk7fo6TPGUj\r\n31sX6xiHjUNQAxgi+Mt/fLoX7fSkM6GY45XONCO7+dcLcs+1WRPIgUmBph/s\r\nEoSLG3PvNKv8mTBeP4Q2FyUt5Qt+EXM3yeBi73au6h+/Xr08vMUQ6r9o6UM7\r\nJudTDnlA0JZqRbPdVBvzBODJLhgsj8/xXynqcwh9ywXEi7j2S+qRwGNlylcj\r\naoCzxoG5XtTgrTE+H3IR4qBB5YApfBK+REcOvybEp6NvhDdh6Ju6wa1V8OVG\r\n+qw2+xQAiYXbLdB15dJHDqBBNpmxEqt0zqxalmkClj15xYpYQzkk4qsqxzyW\r\nbmikN1R4UX8LDJGp+GYAOS9eoto0kaRkmq0=\r\n=+B/h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e834256214e1558a021e7ea26e29eac864614c90","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.12-beta.3703"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.12-beta.3703_1645385896689_0.07246335417985184","host":"s3://npm-registry-packages"}},"0.14.12-beta.3704":{"name":"piral-pwa","version":"0.14.12-beta.3704","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.12-beta.3704","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f511fe8b6aebea4cfe53aeb8a5fd7eeec336bee1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.12-beta.3704.tgz","fileCount":40,"integrity":"sha512-rv05OUZOEVYk2dVuZPAlIgrOlhTscm3A2vvxix24pw3gwFXoXO6kU0VToY20UbvErhaUanj+yu0WGNOxvG3SxA==","signatures":[{"sig":"MEYCIQD7g+QLeoeQQwX1Y8MHovEqCHwf+vXlp9y1xnrqJxe60QIhAPqrEvbguYjMA8ZgY4K6Dvq4XIrpQ0wbCjGStxgi9aTO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEswSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqm4Q/7BEb67tryC1w9x3cjVMCsTefmVnh4LHjEl7L4a5V9l5bnJXzH\r\nMWQMYl8iwK9gdyr7R+SXiT90gHhggezM61oqnu0jrc5FvT52TvGhtoDEztzm\r\n/i/NuySJdYNMKYkkqXp0uCodoAGPQ+x9HQQU82dnQO1HmuueGrQ9Z1VodYYd\r\n349JRo5y34I4tVHh9MGOAdwndLKFWjiUTI1WeJANO8AKp0qp+FdZumMEn0dM\r\nD7dlgl31XscDoslCAbvx2SB/wGpyRqc2xPwCo2eKILdzwVV2JxU5vLchD/37\r\nX9rEjkcvvU0K/WpcY8UCiAdMPYpD2JrwpwvgrvMypTLQb2zjKjfH6GI/YTYL\r\nlI3F8HZy87ues1iH64Nr4SfSdWrvqfKoxfyhrquCSDQOPVE46e4cOiOaFNeS\r\nY8rBtXUb4fiNVeqsMIMR2YxHCGt+hB8rHq0jNPfPaA6FIuCEpswP1D9UStOG\r\ntUHeEzYNu9FdO8vyJXusiCoRBtf3lvfDdm+MQc8GlOWVFXqJagOfkdo1j1EW\r\n7YZ55FR8UbiXx+Hii647DyYSZbVVlXcShxbx8j7SGxQQ4pQyjAQmrfUE4F1w\r\nlZqPnvomHZPptO0mII2mMK0KLjrND4OOvHD7D7AsTqdvW1BAknILLpiVaZLa\r\nnDfR7/z5VxtKGPwYbHhynXhKJRyOQQ3C+oE=\r\n=snux\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"9cef97e9f611750aabb1165a833346a621580d37","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.12-beta.3704"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.12-beta.3704_1645399058777_0.6964701250218792","host":"s3://npm-registry-packages"}},"0.14.12":{"name":"piral-pwa","version":"0.14.12","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.12","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cb2a457019cdf6b46d54d318ca44f46c4569b07f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.12.tgz","fileCount":40,"integrity":"sha512-8jJe94lgquHOQxLe9dETMfZXGhSTz4qKW7/DjGYIYJROycnsWs6RUpR9B2XsbZVR6YUvcIYj/i0ccIMLLCZEWg==","signatures":[{"sig":"MEQCIEDJHD3VDwLokQoKbR6Dwh2Wr3ruzjn4sW8R/iz9JcfcAiAlEa0OdTll8UQ5YrBiFCaRH6eBY6bnM7P7zcNO0c+KpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiE2WVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpAlA//Q82b2jx7HbDH4qSkYA4Nk3liChG3AdSPu83XeUypCk8wz6Mr\r\nM1xDubYtcifmK8gY4LSAheEWhJl+uWLwcKf+Qzl+gw6VAjwevkR41Nn6Kvg/\r\nG+EtZllOWDR1aMTt1hIXFLgES80SnmYGHCFO1QHubm2wDfUKLYDJC4JeBXwc\r\nHXSH2ylrs2GyrdiBsttMipaCeXgxeNvpGJn1K46vHvafPYbbXO66tYcHMTed\r\na88DYz196ZzQ78hGlpbpgNbhpzk2YqL3QpydLcaNFTaBbS3Mn0dJcFWAa7/z\r\na6Y2F0LUDDGDMIskO7UGrDBI8bAJJbwgYq5jI7d1HpWGM8zF2+OagHzMOE3t\r\ns1Sczl8rB8gCxbvF0EU1aeVV9niUNQnNYJv4WgGKy8U3sUTHAknni9bp4dAu\r\nrjdA5CJusjNfHV07gjgL7+v8QLUh1yNpuqKdsRjk44WdNcFbvYdWyFAalrZh\r\nJEMuZa2HSrjCxY9OcyaLQ1WEW3akYs3ojfA4VVP5NPSf+4kisJK9Rrfe30KM\r\nUy1mRhavQQXnv16n7AUjQbgtrTg6dEPldFUuAMWx6ME39nIe1nYMmOiXKX8D\r\nf7AGMl70NMHi2mdBt3VX+oACUL+x3k3pdq/xknVGfNotgPUR1DRsHSufWT/d\r\nm11/mF2Cmml/yfkCakeDMxBrTE/knuhRzbU=\r\n=chOs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"a75b9e31d077eeb9e998b26b32bf331faecfaf19","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.12"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.12_1645438357342_0.42359529615388336","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3711":{"name":"piral-pwa","version":"0.15.0-alpha.3711","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3711","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"beb7be25f9ee8f3580282af874ddf4c9f36d8c1b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3711.tgz","fileCount":40,"integrity":"sha512-lG1eIWl2fqsYn0+G+zu/sDrWbGY43/RGCrnNZ9QTihIqMaORYL8+ro4KQpAJfiXvFp1BdbBShpB1+mP/GCmQOA==","signatures":[{"sig":"MEQCIDdc2iTgEfDw+BLmVwm3NZ0+i0cXiK9YLPDqjKbEdRpeAiAF4qMz6+G7PsDKkIlX4XdK5G5QnwY03S6PBJxb+GO72g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFAShACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrChQ/9EpeO9hQ4RkKOiHWv1rvYoDdmjOUqjYdKmTwgiar6ICr4McLM\r\nedf6PISvAS9zGIBStLFHFxQXSUzYBeihWphLQ+C2TLGH/77eXtFfW9pDtpB1\r\nD7BpWd6fSO09wlhHBr5qAQTkFUbn+wxw7+/OPX1rJNOKooPnnHfT1WnTWP2Q\r\nFBMzsu8uVsBMCb0OH6wSjeKjtnnzYCDcWtMXfhChUyqGBI9fugC3dwDiII2L\r\njcpKEZnX0OymDUeIimftUItzde+NvOvvBL33DjyUiDCqrBL+sKD0UigqhBP+\r\nnv4T2HpKO01e7Mr3Nl8epmFhZ/PZTqqvU+2CCltjzzwhz41Do9+b4kN2OYPf\r\nFDNvBpe7En5EsLVPHAcLBVSfxM/HcYkXrjivFD5BNGOLmx2ggu0jSAm9FhAj\r\nZ99ncJN27wqeceFCt5pvAglxAFoDb1+4bMG/OXDZ7B6B6yuC60kJmNQehH/f\r\nbPwNDTzGrYjUk2eW0zGDwnb/3Feq9jDK1TuO/0F/UN+gTYkWCloUCuXnbkvY\r\nrT4IgIZuhBlEiKEWwV11c1vtu+pUuwgv2Y0J5AD+YGxVcUUgzHzvvSk5ty23\r\ng3PeWb8xwVKd2ic3IKHvFfcs/a3degrbmWbfFheMQcDLswvS/Q+usHRYYIeb\r\n0dAggi3KS/AaGpVOx6hx71PMYpzObzVBDfQ=\r\n=xpV4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"2ef676e46e2fb402edeceeb3b4f1a1aa04c99970","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3711"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3711_1645479072972_0.662999379800016","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3719":{"name":"piral-pwa","version":"0.15.0-alpha.3719","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3719","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0fde90057525210327197f0a141984404bfd59cf","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3719.tgz","fileCount":40,"integrity":"sha512-dk5/7l3E4W/zLm25VFoy2YVeIBniJbwLG44OPxqkiC5To+zhxXa/kyk9zXn5vrVIL6bbulfjc0aQlis899ARbA==","signatures":[{"sig":"MEQCIHPu5Vuq2vYucqR+2FpANzVJb90ovVlj2yMu6ZIh1IwwAiBu5FCCOM8ssHiUe6e0jxoOQv4tRljXZRaSItO6js7KTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFf16ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTJQ//Qq6QB9DeNqa/PO3CrDmz/APn1bSGg3w8jszT5qksYr2Qd931\r\npfqEJGDxSOqyutDrPFvd00CjofDWDC+vKdjn5ipqOMPh52I3hTR9heFHzZDU\r\nF/opHobmct6B7ddc9WC66x0OJIe1zQAKnaTlgfgkKu/7l1xYQCjs/ZIPwO2y\r\nUIlscRZMzMKt0uOkkgrDFmy3vKRzpx4BFdv+2OqnNfgl9ITxnN9LqLNjxuxQ\r\nT2A3v9Hal+1F/Ub9ic8/yeBdM7jNMJP7ENjOzaQfzS/UMLIF5KpzhVMfBk4R\r\nQn5OgjI9yOZETcHUhusdw/cn8WoFxtwUdFlQl5d+zxotLFJHWmf81B2W4hwC\r\nS+26R6lBptwU2bfh8YHmeWMPnpNzjFJHPfZ76Xu0zTRgatDFqTQbhyx8e5Jm\r\nlJnpOaXhNdNxD5p6ePvRpSdSjjAtHLSLx+FEq52OKWjRKTLnzNs+7Fmwtxcf\r\nOtcbgrl3+KLCtmCM0H1I9CnTmZwerDdd8hZd9cdHrApI1ndeJdmEdfVQ8/Ti\r\nP9y+xxAvv2zMbmISAHybN/W9iPwOj4ZdlkTMiriwEBnAVvBA98rgq2kpAWCL\r\n9UUqgHkO4IoRqEN3JFfYCR0pSau7Cn8pPM1NdCIPxlDd6lZKqwqEWpqmynDY\r\niAS/DmT9TOPiOXFD+6FeRzBcUtUdOqAHeTc=\r\n=jrZF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f40561b82bfc877ef475493779c4378ed67ebaa2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3719"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3719_1645608314120_0.5242763799422427","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3724":{"name":"piral-pwa","version":"0.15.0-alpha.3724","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3724","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b949713f7b298e1f7cb4ffb1a5190389868fd5e2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3724.tgz","fileCount":40,"integrity":"sha512-kg0+cK6DV8z8zUy4FPpYrawRZgNVXkfI8ncDitU1JWEFiWoK9lokmwtladB9+e+oCFtJsU1Me4YbFU1r/E9r9w==","signatures":[{"sig":"MEUCIHQr48lySXnJBqfkLOUkTdZdy0NocgpDg8J0pvamufLtAiEA3hM1UGg0dRPuHvddsQcwK4tgZOSKgPhVPdRnPgOQZag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFlpaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmokBg//ZrNveLg9MosG0cHNLQEszv6I2JaxUO/T8GrXVhAWvjCn9HX8\r\nV5ciXiyRKGxl1CQie6tuKPWE9MgbiZKPkbncz1Bb5JXbOIZuhjEwEfI93Jsh\r\n2d7hq0590x/UtfbJ4N7skSiDINwVUaGamPoRLB3101GeC2vG3YHDTOVnF9j1\r\nzINe3+NX/pIXDcKo3exz0bZ1CB26azyU0opeG4dL7ovflEx1LGtje96tzYSj\r\nlXD3zfCbjGJS6FYMWadriahzz5NkqQVvuuPXj0PeJFgj4vEOaOwmUlQmIgv9\r\ngCQpVjPZG2QUMkQiySaoGWB847HXhrwbaQHvEtCIXvGGI5FxIK2TTRmDLMpo\r\nEaI1cQck1tyz5bjtLitmhXZtWCHeD32sVkhZSV08QwqNVCawvN9/yW3Ftvhp\r\n0UgGXE9V0YBKE7Yw4JWwkq+TM4mszQEGgeiIVHLy4VkLujTS1pjWlcHh4uLD\r\njuS0CbhEl5lDioIhJMUifcO7INvDNIi3OeiVyMdvFfTXq3JkZUZzVCpYuh0I\r\nJeHwpDAs3cMnZCeIpVR7hW62CEHPr5qSmY6n4xthI3GHS00df51s8HEQEKza\r\nR37IGmX7rSkAROWH3Ra8QMVnudmOTystJg6j2q1mu2IBZpABLD5lgF3p5VCd\r\nBduPurQkmygOxwJrmfxGp2FOq63qpYimjLw=\r\n=sxtX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5e2da2254e6d06b72094cb172293b65fd83075ea","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3724"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3724_1645632090261_0.1626413289116817","host":"s3://npm-registry-packages"}},"0.14.13-beta.3733":{"name":"piral-pwa","version":"0.14.13-beta.3733","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.13-beta.3733","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"35246d711c327f6ef0d131409540760e1613a65e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.13-beta.3733.tgz","fileCount":40,"integrity":"sha512-TbAS73BmZJb3mF/jqtjt/bMfHX6f2ozjM3U7QAgtncsRp5Hkum/xotedCuUdjkUGOfuueWCZfdr0gPqMUcgHGQ==","signatures":[{"sig":"MEUCIQDZ9lU/NCOiIeLLb69dsx8f4KB9bYBNg0n16qQ78TDgwAIgJOxVlOyyxO3yY8TyZPQGJUoaXhNSE0awV7O5iFiVsbM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGkkfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5jBAAm6DPN4N4fDmg/8PEhp5Lkk8QAxtxFWuoZJgc962ze0bWB+4q\r\n6Ate0qFw/6JT1tpNvcOjRnREnpctvpVFD6N1LOhUNuLkCqyGJ6gwtafC7kpl\r\nyb8JUlkDRXXO1cZTsFQ35+n/zQFyVpGLEZXXWh5SG1nR1tfrxHk7TMwSIvde\r\nC2ZNmuJXtrOeZxubRzoSkirc9Y5ZQLro1rTSd3ALufqaMFv80GDP5qZcCYMq\r\n6Ne0W1K9xr8wIsdved4gcTKMz62orGa9U3TSt4feGoS9u136DnexG3S/zIU+\r\nbhcF+PgZTndUMxAONn13JhvF8wWvKuYLoQyDDSMBA+HwsSt4OWVosrxStXgQ\r\ncGsICFixrY5eqsLwKds2so9cxyDyVtxt70E4zvXnVyc2C0/D5Zbwt8B8HN/F\r\nivh0nf2hqT6JsHmEsGA/TpoEL+0i37XBAmDBEtGEaqS2VkkdAfVtieL0hFCa\r\nXt7YpJyhql2dPj8eEeqx4yhiyI76e946Qsw0TEfUudNCI0J1ytGjlSn65LOQ\r\n16WYr1AKihFYUtNsiGM9aK/6/q823ahltHFRR82yTYCHXet9GKL+0hlq9In5\r\ngfDZmW4XvxejKBY2aXaatQbDQw9/Eah5bEW69QjrjvubN0UY3ETy4WdurMMv\r\n5IoLRJ//iyO9BTvcR6XW3o5Bi4FPscvBM7A=\r\n=+Sxe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a2d6fc488718841ca6c0069d84fda6c37768928f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.13-beta.3733"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.13-beta.3733_1645889823522_0.7373802218941439","host":"s3://npm-registry-packages"}},"0.14.13-beta.3734":{"name":"piral-pwa","version":"0.14.13-beta.3734","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.13-beta.3734","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"40ec6769230ef43d1cdc640ac221a07431ee8710","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.13-beta.3734.tgz","fileCount":40,"integrity":"sha512-5sHRK3Hpdhn8zriIQ6lX8vh/fDn9Vx6Dzptdm3+JybZyT7YyU4jRJ0lbEQk06vZaovU8mGPuvGOsCXg7k5DvQg==","signatures":[{"sig":"MEUCIQDluFC5ayif1PFhsSlm6rZR6CGbNiGt9zoWZ54LfkcnHwIgVlm3N82gzYHLO2GTUC+O0uzfSpQ8pKmdDy/OJRVBRj4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGrNOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpX8w/+J9uPkA6uTSTEs1q3y3R2RXgRtK8okAvbc0N7PCA9efsThDmD\r\nS27YVEoo/gkrwhdWhsGVk0Erz58cf7lrt+rK55sy1q+8pzRJZkD2ZJ1W3u9N\r\naCYXlGFQBPDLeUlDXtqLi/3ssgHtIC08NPyfXDDSQdFbo3/S1O31SVZnUVYu\r\nnj+LpXpi0P/jeFhGQRdL0BQxNM6NO7De0nizO9UT/7EVbdC2OR9Zf1v9gPBX\r\n48UapDJz2Xv4zpo4xuvCmuMOH3gwHQfUpSsfFdgwAr+VPrp8zDYyA8IHq7nB\r\nvLc94UuD2nt8K2ng2lYgsX5wWuRPT0AYuFkpSjKJL0Z7KsT4itlkoCsaFMJ6\r\nBn2ppb51Zf/tD9JRKVGY4SCHd4cX8Amb5IRDPyApPmiccq3YcbLsdxxtjp+8\r\nWEpYp8UMu2iAjdwX5A2nPIaURClK2mxWZvTAoavqQtZ/5zfPWAqG+Y1uuZAY\r\nSwUnJPiN0xoU5lGl4Zm7TUftxyzzXzXRBJUmO5wVWP7YIeLdQAAmlJunoGod\r\nNepJBxFGlRv5uLiiLP+I80cHKKWWys8gclFevkoZGMggcdeDh8EfEnuZ1SyU\r\nfKHftZSiotTP1P/HmsLb5UD8/eaJ6s8nhhHvkGJlt5hq8/8w1oQqSp2g5gw6\r\nnbzvcFk1dFSDuKzaCjl0ZFnI5dE7F28Ccck=\r\n=XRui\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"4dd8b55919791bcda74969e3de6c0ad04ac26e14","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.13-beta.3734"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.13-beta.3734_1645917006478_0.5543809533000781","host":"s3://npm-registry-packages"}},"0.14.13":{"name":"piral-pwa","version":"0.14.13","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.13","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4b2e9e18eedffb664b0bd625b3431f19403005ac","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.13.tgz","fileCount":40,"integrity":"sha512-ol239m4DGrGFN4CkjdkV2pI05keWq3eHM+/MpGS23wF3W+cKOOteidwkltJ3FYwWiKrdDfAbM9lhnWNs0otHJA==","signatures":[{"sig":"MEUCIQC2TaotgVmbFzTJ3ClF77Yab1ONuhqOitBtYsl0R/IdVAIgXtvhPTs80nwwJMRdqS3p7nNbp0ugREfcri0trVyjm2s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiG09jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmuQ/+KW0nBTNhJ/ESeO/Bk5DCUehZzYqpqCPORtRxigpbSuixXFMX\r\n0e9Kn0ice/l2P2mVKSh9749pboSbjnEb5uWaaFDvf8ciainsGBd44tV8QFrp\r\nm3n1U8MN/TSr3L3BKNpawYjWTkBC9XAPwAoG9E8KBWrJAC6yUl53B2mY8Oej\r\n8UMMTjLTLxmOukgpA+snkI6iC9kEyBQNkUB4xJvmEzgWA0a9o5cEfrd9keZ9\r\nSsXiEMIC9xW4/tinps3vm5somtv/j8QLZ5pQsh2GspI3jtpkXrsxirYR8Mso\r\nOqIEb1boYaAyhiXSyGEy2IodmjZTvkxd293heJPq6UYUdwo9i/qSEYc4yGL/\r\nxEwDpmLg3EivH61WDHNDNtsnNw82e1f+7F7PdVnE6w1NamLfErz3UoK65enP\r\nIpX8+nJSOtfWkB5JMFDmN5JikBJbLsfcagUsOPNAuIdkwXoZJRcHJX1YwD6o\r\nrViXnqea4x0+mvcfBJCevbkeoOyNDiRjX2RRhk/WA52dkpjFm51dAvVsA9ZF\r\nMuhbFCq2rkNgps3+HfkBHTm5LWvWOM4riljUqcLWuoHIYQYlug56qcmggXTe\r\n4qJaizljzBw36PAtJaVzOK14JL3EXBnIHsbXzmSkxeCRnISdXEa1W7s+XRVu\r\n446a0+pRwXlVdMtEpulJ29gfVQEw/5nagJY=\r\n=WqkM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"6.14.15","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.13"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.13_1645956963348_0.0469229236635933","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3740":{"name":"piral-pwa","version":"0.15.0-alpha.3740","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3740","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"95df5f0bdd910cc07d211b0404f861762b01cac0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3740.tgz","fileCount":40,"integrity":"sha512-GVSlz1Mj6mrBFeMMtQjavPpKWxK+5nutNvLo3aQNlAKsvEY/wlzV860n8eNZRyxQjsSshYLgswMmJolHdc0UXA==","signatures":[{"sig":"MEQCICHVLGvlIjgL9X75Uu+7QTmdLuMtazzXa2zATTOVw3a6AiAQ3dOQI7anCpVNM8Btpq5vpCCmXowKB7qjQhZvZWAYnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiG2vVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJhw//bm0Hpdch9pSO2nLsbDPZHxJWph3PTp0O7JOjkINnevT9tFq2\r\nkyA7soY1kK6q/AXZgvudv/r08QhCtwpCGelRNZaKSRH/qWIl0kNWh5DlfcbM\r\ndDVVqb68PoYOSN7L7G6W3PpDYvotWS8JroNZHgzCnOGSo+f80RpkOlvBh5dm\r\njEzVSHEYNKuY63mLfcrD6Z5WoaLJbKKFlQRs+LDqfFcDboSuRn+j6FUH4L0Q\r\nYOJkGneOd6OuaS4qEd8VAISXwprcUxvYXL9hedym2uoYh3TQ4rmyJO2Oxonn\r\nE69goEV4ypb9scapQPjblEmvHq8vMRPPejwnyz/ZfMTU0XABhI4tCzeHniwA\r\nBeZKh0h8/Ur5qikO3b6/atNw/LGNY8+muJZAPtdVX59q8qD9iqgs1RWsoUE4\r\ndY26DhwBu03MFtgO0DS+/8hFpF/sen1w2OS/hXtzzhdhjahDzY37WR03biVl\r\nGeDdT1baYs5tVI+HEqR521f0qwcaYzVAtNiREbLnsUgncVGS8wiaYwP/72lc\r\nCrLjMznd0i4x5I+3yqbQes0zFg+Vsd1NNetlgUzple1DfjAUBrM5/iFTv0QH\r\nwQnmW2fy5/yucfxfD8R+qtidqhEO9WJRYYdNRmQE2SWqP1gzThMyiBd4k6IC\r\nHesZ5pjwL9EbWS4BNQPZi1YIMBzYTJYyKo4=\r\n=XWA3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e70f3043f4e6750dfab89dd5fd7c9da874cb2883","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3740"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3740_1645964245329_0.08451645535483365","host":"s3://npm-registry-packages"}},"0.14.14-beta.3748":{"name":"piral-pwa","version":"0.14.14-beta.3748","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.14-beta.3748","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"793732999e6ac1b593d8f23c96534380e12a96fe","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.14-beta.3748.tgz","fileCount":40,"integrity":"sha512-Hy14k5NUXpHS51sXsDAiqGnBKMxOOrySF89Lc7lCqDUlcEZDcck62nz3jTaQUkxLKoEYatukHI6lz+pEfgKGPA==","signatures":[{"sig":"MEYCIQDsv5rzCDdc1+YSNUbKo/vYsh4cKt+mV6aErHUmhXKYtgIhAMAploDtJCoC4IlD0AmONAp0aLBlpan5LFvSDWFvAicj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHfs6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpy5A/8DkpEhCeQv5WafojERmeRuZgdh4/wC3G1I6BQUTMgcOWqAl4W\r\nTIBcW9yORHpy6xNRYJXrA9ELMOamril3A/75vbsRiHiW4FoFfbEZYIJuKgLt\r\n7DShOJk38FhUCa6FK8YyTR+4Y+mBISU1Fr/DwBMRKbvBQvV1MfKVizIEEMR6\r\n4MOqAX/qEdr4T8VB/nGK8/TnxYYtdh4ioZ3NejueLte0+jYbG+/9CWek6Aa4\r\nmrEL5cheOfssErpYTTHb7HT7ADQVd66KoEWFPbHanqbsGlSrU6ZnDr1m0rVJ\r\nQfM7sedqDX/ju/65CO08eh9yd/1ckorqd4gmRTl/17xSG4ThpOI4EEDsGWZO\r\ngFLrkSfrKC0gTnccyZPfQTybW+UAvd8fT6lsY2csMh9dXuE0dMvk9O+sYZJ8\r\nT0J0PCw8HWvVLTbq4OwX5uC53Tq+bQa7DekruFxj796wU51BvfSr6lbeFdzM\r\nx8VFqInkVmMGGeanX2pX/aTQT7u3ou9NX9pvTdWuyl8ZGiw+CGjniKDXLpsC\r\neD7TM/NBSPlH4wN8D43aKKmJGgFTaEPdisTTLY1HuTDAXpExDN+ukFy68/xY\r\nd7jauRe+rcyEB62XTQ9cmpUrH91NazSkVV0KOq9+7fkzu/arVlJVcn4AWJC/\r\nPYwQ+9DVdfhI5+BPVmNmTTtCBxUhedXIR8E=\r\n=Qlqc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d39cff6f08051897f87633123c601f723a83fd18","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.14-beta.3748"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.14-beta.3748_1646132026424_0.6949543073697895","host":"s3://npm-registry-packages"}},"0.14.14-beta.3753":{"name":"piral-pwa","version":"0.14.14-beta.3753","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.14-beta.3753","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"350b18a47cac17dbe27d05e6aaa04a7576bce0f5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.14-beta.3753.tgz","fileCount":40,"integrity":"sha512-YOu3g0+8R10XTMG6Vuz7MKqS0tDig0w53w7fknldV3iNQD5DVUFWa9/Et4dbvduzDUJSvCw7lmPl9N9hY1vGXw==","signatures":[{"sig":"MEQCID7dq3jZ+gl+SawdskGPDPZNmwAcrKA1v2XLmQzSJ/SmAiA8EXVSJCSPiDIf7DEGf7hx7Ypkrr7trnIycgzVHtJO9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHiZQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrk8hAAnW4NCmaMugUAhHqM6tF9EYLejCLR57m4OWvBtMKPUKYWUiA7\r\nZpZcqhxnuiHW1FL+2il6iplZE2ZwWx7oqIY2cG7nP1aC0noT/QFEo0oFg3il\r\n+9Bc88ZSF3qXu63UmrfFtH3pBaQXzIjQKKaYkD61lC+WBOx1k5rGU1qPjAim\r\niOG6otn9GOUwOuh3Pg0eO9ihV1MKHXrcSQcz8WYeudAQ7WLR9guEYvICXpSr\r\nVvW7dzZ0BefNeIU19xLJfazMLjR+D6+sNnvhUyoM98hbXPosQlQ/HG2unJLn\r\nbsJBSYI9gAfpF8s7PBEpDQ8SPRz1otdTO5EjQGYGZuyg1xVUgObKnvgStgiM\r\nWhTjpJ09msP27sDomIj5PYsQ8iEid/pEYLPHEDWbSqZ2bTP/uJzHEDggsziY\r\n0WfFszHXuEhZojdO/hKZkepIb7Cs5gOHYdXU7zolgU/u1jy1Tn9bEVkn3rBk\r\naI5J7gGZL8rYaDZ8BZqDnQQ2GmFZu0X1P+/VNvOdE+R63PhkqsPyLQYm1FW6\r\n+E992zrAfBecXAa3g1PPEbIkjpDcHFWVXj23C/35WJx4qG6/TN+zwGSO9KI9\r\nmudSW0LE5pBdlRK+tJvfgxAAHxMEEuZE4c387v7w2DYa54lNMNyIIAp3+IrM\r\nmLRG7rjZ4dYqe46aQwR0VvWw3BwIxpuwyFk=\r\n=BD+k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"34acaee35dc0edc17e08871ceca641fc5812c504","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.14-beta.3753"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.14-beta.3753_1646143055890_0.06600224703526703","host":"s3://npm-registry-packages"}},"0.14.14-beta.3765":{"name":"piral-pwa","version":"0.14.14-beta.3765","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.14-beta.3765","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f7556f5e754b00f0bae67114e2fbb95315efa899","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.14-beta.3765.tgz","fileCount":40,"integrity":"sha512-LNoOgmA3OkYELn2+1d8MbSZpOd03hcErqpp5dNUGfWd+boj2bqVzVW+2zdZbKjxZ45eNZwj942g2rT1R1BjRCA==","signatures":[{"sig":"MEUCIQCwB5zYOw1hJ8bj7SRipe0AxpTi3/S8zDG7SVA7oEi3EAIgCp0kHX/tbUOfwY6B6B49+gS3CWysRjDgA+GLsJ/luRQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiH7AnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxTg//btVc+LDtPxcWPG07IqAnZjl/8um7kVSyZcSz/3nVjsgFEKHG\r\nA95T2ihTLREzCbOdALaylvSkuQ00JOuE3SVUzddEwfXgyhRI6CWr0ArzBJyo\r\nURZU+Y2aVKZgQe5k+uiTaSvPNVEQmbruLf7BGJoU55rzz2wRrciWY14mECkV\r\nLrn2kZz04hnS0PwOke33cBeEUCUjlisDTEys1yD5moh0k7l3r2OC7PuxqHvg\r\nQ5UWt6JG2z6114GuKaU4lPrud8gFqb2qZxir7fl2CUA5NHBgiV/g4f6Vtdx8\r\n5SyHRskvMu1ATqaFsRATKkErrTjOTEgZEGuY+0aVaVeKvPeCEnZJq3DOWz5o\r\neokVlW4owxgYZ4C5v02l1aXD/oJMsaO9ZgeuuStQGzOWa/ucFbgmv1j7Q/mp\r\nz9Ngj2cpDMC8Uoosah6H+HXadiXwFrlebw67lYWRllgVVPw78S8uNSl4CkEo\r\njZ6HwXRss/CfYo+ufY0kBt6cjhyx2sx+5IPBCPlWtaAC9Y97Sa1JDWyGnMS2\r\n267KXRrckZC5XSfrkoV2PrYaHntLKGRsbWSs9I3Z1UzCzVv4z5RTQ5JjkDO1\r\nAAmUaG2jU6H/H9Y/KVL0hTKBrEOyZO/i44Kc7o3lSLbetyvlj4WV6WuCG3Sv\r\nGxMXIY0mUFOKBY79v9ej5lPJ5euUnzFVoUQ=\r\n=Q8cp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"f933f63d8d746f6f592e6d62a4f74921d8fbcc01","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.14-beta.3765"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.14-beta.3765_1646243879635_0.5478592946277321","host":"s3://npm-registry-packages"}},"0.14.14-beta.3767":{"name":"piral-pwa","version":"0.14.14-beta.3767","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.14-beta.3767","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"882fd3cd0f6d9c5fc4f474b8a59f34e52ffa8375","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.14-beta.3767.tgz","fileCount":40,"integrity":"sha512-WhJuy0H5AvToUhETnX3ARs7hYd8Q2vc5N/aNAa01xalhVGNQSqzpfNHzOusOcFg4ubs4Fx1iwPw8m3ym+4ULvg==","signatures":[{"sig":"MEUCIQDt729ShtjV1Xrr2BL4U/uJku2lTT8JXjF8rk2GeS1pmQIgaR18wHPdv1CFVEzwIOqiJsrHguM31enLv4sNRfatIxA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiH93AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqN/A/9G/wRDMBPuliEmPSHghW9rnTVr6mOZPjbR18CzujLIBygpYFF\r\nneOgyHX7c8fc6UESwOZ7weTp/I5i+AHJgI6S+dibHblTwCI3tkB78HK+73TX\r\nwvcFLywDb8ircP5MFqdmWfFo2jZjCpr9KdLT6GHezJjUbfrGpeblsr9/41Sh\r\nz3i/scA21OB38IJssi/g0O00p+2PlTUa/NeLVGsPihy7SZmNpDmT74S20Taj\r\nbPXSzc0n4Mg6zI/E88I9Zx8ckuFgtdoP+2VDkCCxBRMloVQgN8c2uLmHg02s\r\nPzFRqnCoqBmhLzcjI0mwfzOKVE4lzeS+sD0jzJYhJXWLyFsmfT/6fWzDO8jH\r\nl09DXlJRTFq1yzg3EQOsYKhx+S3Nzv6h9Vw8WGcpEyemkxlNlS1kwYKeMvQ2\r\n/6d3gGRBvFhzZ/v1/t7YG8cJOZ/aJvqjpGhZ/mbOdZNlrnz+0vGxSo83e3Hu\r\nXRaRL7TB/wkyj76p/pdOj8AG1uupBf20kgFLvwkiAqC3tV80Rr/JBH5zW2uR\r\n9BbjdRVI2LQVZ4E7cWE8jjjw29nf+/DL1IAWm4HiRQ+uU1NrDpjP69fuHpZZ\r\nTseh53Gw/ifMDPbILPFRCJUkYZ7k4VzgIlDP1sNOkEfvAoQ8rPD5a7zXv9Ow\r\njsSUcIVt7VJQrDsKTYOIXCMmiPZf2aT2VSY=\r\n=9inp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"dc6b4718c8d6c7b17bf3262cbdbf97bf0a4b779e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.14-beta.3767"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.14-beta.3767_1646255551894_0.547276608284821","host":"s3://npm-registry-packages"}},"0.14.14":{"name":"piral-pwa","version":"0.14.14","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.14","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"377e2c3e60903adee547e142bab59153c8b06792","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.14.tgz","fileCount":40,"integrity":"sha512-jVhfESVZv/0wyrXR3o3olwacBaTv+1qju4nGwn0ddObBQBCZbCMgujygaFohUx99698iKlhle6Ekf5mNRupvHA==","signatures":[{"sig":"MEUCIAk7q+wM22gb213Sq5td6WhFbA/x5tI/pnQn4RO+YT1RAiEAuusnJtQDhosHYJ2drCogCKfAfmS+oVKvRnAJiztK8pI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIBlaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLVw//b8Armdu/7lnwJxe/vZsFPcC6//vxncUtT+CqcTsxudhExJ5J\r\nTfYRtkMICRlZG2Rhu3hn5TSU90ui8GY6Qf6Hw/3I4te/V6dKtqcR1WAVR56E\r\nNf1ba3vT2LwCwtLx6AG+AcVJojy5mlJzy4AycvBwmyIPFH2Ab5fPccfJX5EE\r\nhXA0RYjO6yUG2ti5t/U/P8Nr68c9xwNIyLO+QE95yf9amhJ/Co89jfaobY0Y\r\nUlCnt0XuWsK7SER/RBheH4fOAKbsPHuc8K6Oyht7WgQydn1UUlYOm7j4YQ/0\r\nMmPzWUiTAybhGTC0jgfht1ojsQ18W3YcyWdwtErOxhiF354kXVSHEB0QedFE\r\nLhWOgzLc4WUXgc1HJniMIF/rjqEqxVehHXAcDln61LAM3WeL/x3YtE25tRgd\r\n/EMVZ6uoRZ9zzR5ri/3n6WQMVmZ6XZZktZaxZz1Aoty1DQ+ktTX8XwrU5j/C\r\n2wxEjYMWiydzRGJDrHguUI8KJiUVYYyydUYQ0KSC5OePh4VQwd9K3Y9S4l5M\r\nP2Rk69dJyKV+8uxh7MxIbyQCpuL7BEMgDdNjAYrW5Fon2xqz558U9DUUjgUu\r\n5RhEHjUSynmL3YwUapXPu3fMriGZZs8F4Z5YUrKG+6JCJpuokIPZ9+FEcsx9\r\nFwFOHepUxwvQMSedtu/oK60ZsmK7fCFBjSU=\r\n=2gBO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"0562c909cc402eeeff4907c9db564f5265a12973","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.14"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.14_1646270810071_0.42213856519717985","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3784":{"name":"piral-pwa","version":"0.15.0-alpha.3784","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3784","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"327e55149504e59f9ad870172811c46fa4aada8c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3784.tgz","fileCount":40,"integrity":"sha512-7tSFZ4wBDG19YVQ7Et8Nls8a8kYmqmdhu+G1V0CBSlc4Ag9jpEwX0ObROLKUClkg1ZatKS6oQPGSf35KLqic7w==","signatures":[{"sig":"MEUCIDNRsgjDMI21TxCNM5CRGpYDWleQ+N9DCiG0z9bokxOzAiEA/YpaVDH20A5HrV/GJ8d/E4P0Y3De4bf4tb+pccgMm4c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIT1NACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZUw//Uj62aO/D5VZ8l8SdiRp2xxGBmpiS6O58fjr2VEfoMg7I5u4x\r\nybcqFDlHp0QEPIRDQAfHRmVFm+1qnf9dqqndJovNPoF+a4jvfHKNCu4ttles\r\n/+o4DKFL3/AtE4+r2xkl5xAQ2Eg6+8SXjUADFEaL+RtLXYGQxstXqRnRPFmv\r\n6ndJVc8AM3tYXJRp4Zdinm/zVZ4rjlKt+fa7s3jK8HY/2PEp9vMF700HNkll\r\niC8lSVqqd7zWSy2DcS9UdtiDqKB//3tXAzRlQaLEwlmw11zXrFZhv9rFLpS1\r\ncoMELCAEkUXv076VFjGgFvUNFJi0496HzqzUZmZriP4TG519hir0qdEPYn3o\r\nPj8YzBuZJ33Yadwwxw/ycPcbs94vzaUWz5b0kqjAkR72HGlTz3HAbEgIBUPz\r\n7sKzCE7AbDcB6ne3Q0GGZxAThOYKHYpimZvD8TbEOS0Lfa0cK0Y3+/zoIZKd\r\nKIAqShJONEaN08eU+awU2JZsmUAE1d9vemhqwe19zMNEvO5NuXsQrQCnQSv+\r\nyxpNjt4xDmYsV7RRAr0iuUO7lVRq9tu2KDBqbDkD4SWL+3SrF0J+M/KlOSdq\r\nVjvjRSHKGzH5eGtH0Jlj7Uq6NJYirW1vsoAjZjKXOZYHtE+KFZksOfjmprEE\r\nCwUrwaNE9pL5LAgIh39wCCH7mtSWf9sxPAQ=\r\n=xn77\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e2dc030bd7e656d349caf5353740e45329e471f1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3784"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3784_1646345549275_0.7875533423099697","host":"s3://npm-registry-packages"}},"0.14.15-beta.3790":{"name":"piral-pwa","version":"0.14.15-beta.3790","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.15-beta.3790","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cd86c53f603b8240af12642976a784524b83fb6c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.15-beta.3790.tgz","fileCount":40,"integrity":"sha512-rAcu5qkWZGJ4yuY7xlW6rjk9c4XjhCORKa0IWUpZYAXt3SeVPPJykflTxOmVb5GvGFzACNRnw2PD98RuoQYFlQ==","signatures":[{"sig":"MEUCIEwou0oYSoc1t7qSoDBdvEVjWJKkShzzYdzOPt+xQ5eKAiEA63F43R1ARo/vNn8VWZlnhC2FlQTFSmOXVAC9p+Pc+iI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIhk+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPiQ/+OcBxBmHbZ8ym4y8uXwBioG95HGhFyQwB8a2LXn9mdtfLgaMq\r\nXeeiBCPVrBcUjkDTMVLEBdS7JyTb7OpY+HRU2pE47/USTIPUNUyltWT6xa78\r\nWrWymkOL/bDV7sguV3sU5iDS+ANYHeisjR+xvnHq3umMevBOr6F8Dadd6h1d\r\nwJfHRc/WhkqKxgvVV9lG9qmFCIWW28275YJqjGuFrTZ3oHWjt6daKunO1QNb\r\nz47NRWpn7lAAUzy+zkNgLQicuP8TL9ZKbZlHKI1Y/7933BNZr43TqQ37LD7N\r\nH+Qtk1/n1p0Oj0XOWfXBp4WhbB3VXsRyKG4PD2otQ4FkleNE9OuJOBnboakP\r\nSlJwX2mug+f8yx2oX4PaKX42A7B0+bDzZ4K/EL6IU75lnu3wX+mF9xs5huHy\r\nULPqs9SrG7+KC1SPNegoyjQ9JanqAJaokRMrGqEPdtefF9CDKz3TboSqorvJ\r\nh5O28Fpp+TlapHUCpYDL2elPyawM/mjd1TI1r48Ay282Hmjb7eUW9pNfCwaH\r\n10fvbcbCd5N+8HX/mPkDtn6PDNpG5xpW0NNq6GUPa60ydDhervKPO8IiNeM4\r\njP2W9noiL2C2qhqBWzIWk9A7mnORysq27Of5rdU8QHxDby8u8NPVsdJJU1FD\r\nPxTPcfKnQM5K0FRCRS1AiDsLG2XMLp51Sd8=\r\n=Cw3c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"ba8540869244912e82ee8f9d2ce06ee9c5152f80","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.15-beta.3790"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.15-beta.3790_1646401854786_0.27759756081930886","host":"s3://npm-registry-packages"}},"0.14.15-beta.3791":{"name":"piral-pwa","version":"0.14.15-beta.3791","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.15-beta.3791","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d670ab8e39aa756226300dcec3cbfe9973c0edf6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.15-beta.3791.tgz","fileCount":40,"integrity":"sha512-V8lE63WlqHjXv0jVrpR9XU3EDbknIRZtXqJOxjGnH9URBJPdEiA+66DLGniVbyKbpVumDNR2iTTLFvheGe2PLg==","signatures":[{"sig":"MEUCIQD27oBG3FHEY+Y8sWEomOxvapumGqJ9sky/rTeJOzGOIAIgLr90yJkZMjVUGQAe6rI5EkIXiGg24dY91y2vwClCFOA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIjj5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomkQ/+I5BkYBYumvSqm8vFdCU1LFgoAKR2GqlLXn6YrAaUbdcyuT34\r\nFc8cDqzHG/Z+5tYJMnE3MQfwznlUTq0UzD9Sgmgxp+MyT+bkaNrEtAPnFa9Y\r\n+eFIeVo2r6z4M3BJLWxP6IHJTFIykr0kdVMv0atWdT5ZnwMsJWx0yqIovCxz\r\nNjV3dRycm/HOIAd05c5hXt03VEedSVzeojpGZ5tBwaMoTetqovdY6EdrDh/2\r\neOEIKptPt/wwlXBsqLKDsKtprgjNXkFEn6WZAmnt52euwgwlcHYm7M2WuaAX\r\nmMXsOQxYjVkDW0r0flDwYK576bfBgAznWm43eVB3uw8EMfRsLqlqWYvT1Vg7\r\n70jOe85P0ovmiwzHf/yyP6Ua6pa6lzG9idb91zNUVKJ8k3IiPJ0mNh/bDFbX\r\nsiOMTHZ6GGQr1qXUgiffII5APi5DcDshIt41VXB/PDIDaPVQc63HQUVqHV02\r\nOrC4VduiOc4qWjPJ0O23X1jmqgUb5OTF1NqiJkFvCNSOrFP4PYEkSRc2Z2AJ\r\nHIMDlz4HVnXmOwFn6Ad679gJ/nu3/r2YCOwWL1TVUMbw8CoT25JdkCdYhOz5\r\nxqPMq2fu7hLKKA/wNygduu+jsXBvJyAPLPqqL9hPxEP+guHkAvnyNrPoQhDK\r\nQ1hkQtqOVSbrFRcV17+soOrBhxY2Psblig0=\r\n=ax50\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b536bf76ceb574ce0ac8eee5117d73e97d7d8179","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.15-beta.3791"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.15-beta.3791_1646409977559_0.1077518112599738","host":"s3://npm-registry-packages"}},"0.14.15-beta.3795":{"name":"piral-pwa","version":"0.14.15-beta.3795","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.15-beta.3795","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9c34b73f79f3e9a214bb46456a998920a5746125","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.15-beta.3795.tgz","fileCount":40,"integrity":"sha512-/khb8/5SFTQPoC2RENJ7/5p8DU9bUWTl4LXqbDtv4C3pd6EyIPb67ujsd+8jv+9O8Enz97pe77cWOgMCgswkow==","signatures":[{"sig":"MEUCIQDsZuEGOVfG9Ez2AM5hkdJgmtg7sdmHvW+t6iiOeQrUbAIgbO2pN8vXnLWM8i/RSBgNFw4tKggcxhjSwKC0TkHgzXk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIleMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgMA/+L3YKqLUKfr4lErHMQeKyaaHBck0/EcAeMHSwrVpqm5bHOuTA\r\n25UGJefnMxDbuEdLMInuBPsEV5KZpUw7zwF1TKc1cTZOILZQi7Yf+rU9AU1p\r\n2Zg2ZzT9m00W2J6v9+A5tTc8d5BbJXlFCjt8GGnVIeg3Ihc+VCad+Ya0eH5S\r\nx9+zY+fHugtBNsBNH71gwR9N09E8UB48agUHNZ7q9djepXpNWIK+gXoiQWjS\r\nvxbMLXCpcXtnuWdaxMlnLVUaP8XT9VDzoGx+MNdIRo0/IPWgUHEmxoVE/WZL\r\nK0D/JiU6/fHEo5Jnp5wopBzEglHNQLGD+2SteJbLzBhAz1BoTdj4MoSnvIRf\r\nJJYTvLl7d+FHWUQnvkVmdeiTsEU01eclGv52qMqHW9yCjIGWP9cVsFqV28Ny\r\n0X6hsOpC1VWYV5rr03X0z0wJb89N/o51YvtCF6kpyBtZqOct45+tW3CQcgNP\r\nMDzx7hL9VpqnwPxQNfJ6Q7LNMP6b5LIplMsoCqkkKGC1BSWUpan49T7QbS9T\r\nqMicympKFMvxsPPQFMaSeNDpyyTHxZ8NDSZJA/4g0ojN4bBHUK33S8zgF7DE\r\nMKw+elhNFUfjLTGnRNZTH+roZ8MSDRaXIfs2EGDD+wxqZBXEyYPIl3qqH+IN\r\n8DcJecXQbiiUod/EPd3oJlp+LjjUM3OPQlo=\r\n=PkEH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"aa87fe6e8ff473c009c7ad31bfe7e810196521ce","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.15-beta.3795"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.15-beta.3795_1646417804141_0.029137876621710967","host":"s3://npm-registry-packages"}},"0.14.15":{"name":"piral-pwa","version":"0.14.15","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.15","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4ca2894d779c7bcc7620cebbc2d9e6e73f9393ad","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.15.tgz","fileCount":40,"integrity":"sha512-h1/OXakxRarPXcd22+EDCy/0Szy6cnIxC3sImJr3PmyncY/RP9ybRwK6ZQsvDFBXKfjVOEpU5P2R6nE9G0xl0g==","signatures":[{"sig":"MEUCIQDA42tBiPp0Co+tNFSr+oob8qQbgfnBor7KavhVp0JeGwIgF93dE1xQ8wL68DI6inuylhaRNkQVs41sF43HRFTgBWk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIyijACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2BRAAiHD7QPzoZZjaaHAnD+3RiPyRf99LA1P2PbAzlNYg9cRiCZiD\r\n5/OGiBUJj6qFwW35gsAhZK75MDeZv/4TO5sKH4F9ggUARz0BNN5elZhCoT61\r\nOyZOjXIUtL4m040XLnKEHIunxxcjyEGRG2XHPWhSTPhqR7OCfmhUHOK9nl4q\r\nAiwfuIph7dM9+F82Hk4t6IFM9WfFPXgNBErm/UwuaMjAmD3y+Hpq9s0MT0Fl\r\nfMf0neGHtuHynxTrgn6fGAnHwXmEQ8gdw1zg6pIOmxa6h6MXuxGZnGpcCIkn\r\nxAxZm/mE9xzsfNaQpCK6IxyUwsn3lIBNRSsNxc2HDEpPruVLtPORGK1mcpmg\r\nIvXGbD/mI9mAgdhmeSPGlEB7yokhqdqPHx+jRFFCx9Xzc7HxZwdn6wJNroX5\r\nsOTuNEb7wjMisr8g9frlVLf4jr3loJvPvSB9Zf7mF92OTFFrO6jJZ/m+big5\r\nyB3baZsoBcBzoZO6Lnzq41ETZHpiQ2mIx6QVR+NnDNbwJwk3jO/okbvRUkK7\r\nXOEyB4xR2Ev1kv9to1noVOud412zI9XjSNfdv8AyMTZL9jDVMYU6qLPTO2hR\r\n9GdhJLhv6pYe/7upRdxflPx65O2kMDP3cWMWyQH4iCC5TZxtOZp9NzWEEJUV\r\nIsD8IW51KGJXNFa2cBR1A1dtKWnpERitPWg=\r\n=Os4d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"8a2448cfaa82079200bca2a03ca42c0bf56c17b4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.15"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.15_1646471331772_0.6858900626293507","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3804":{"name":"piral-pwa","version":"0.15.0-alpha.3804","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3804","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5ddeb63db7c6e301f9b7b1426c8318dd2942dcbe","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3804.tgz","fileCount":40,"integrity":"sha512-sN1YbpLe5MlDoHILmjDeHCshHdK7gh6dr8w+ANl8i//9mN2iEW8w5GNdbHH/CIP0ZXI895eCfTVnpez+xyI0uA==","signatures":[{"sig":"MEQCIEDV/jwoZeu8qn3hUhgIQzvkV1jJsJ6PU42qMNMZqNvzAiBvCpSlXg2r19QJ8vSSOa8bnCTFiLQLrZY8GMysB1awcg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiI210ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKHBAAmfkB4wMjXOEZ+RtAlS0UYYrMb5qqaZZeYw5PQ2SrV2406meP\r\nKZtMr+ugGIkeHh2P8CP5O9VShANsLjILNmKc8JhaLSm3Zn6CfipHSVEJQwHB\r\nZtV6wBjg8OnmhlCQpzmaAHdHToXJXkq2HN7W7krHlS4g555NrGJJcbVt+AQB\r\n92uK04Yin6cyteBzgaerdFbmZv6ysi6suEkQb+HvEv4XrpEmFacMDnxlo9pt\r\nxmzsil0K1YssJ3UgWKQGGWa1DA0l25OYNS4yPHkdkuksplbkQ2Fr2/xilh7M\r\ns8th2IoQ7yaXHipx5GNM8Ql8ChBJ1NjpSB5Uc1RU6j80YS9j5h6g9M3+aUSR\r\n5cF7oB4aWu5MGi5F6XT8Np59HuchaFtiGpKarQBvds8boou8mnnfEwt0YOqn\r\nPe+/8t/mNUDC6Tap5pC523GoSFUJVS/QSd0tXsmtriwo0gf23eAaWjmk3vQA\r\n9PcXqsWq0ftCSupfAwH/WRWFBqXZ9ZEigDtwBLXCrquVUhnkkkHeSuVBCD19\r\nCiz+E9LAyaa0iC4HuhoXjeuuDboja2FfuJATx3lLnIyDaMU55VYb0Hcp86Ft\r\nCSs4gN9AW8vDBe/BgD/0QYfncg/1hwLkpHR6f2XPUWsiIsegoRJK5dAtCiPb\r\n3NvWWrZgiLnP4RMtYsDOWqupR8Gkh/PeWL0=\r\n=kquk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a053a21f6195fe292edd35301ea19d5602129c79","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3804"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3804_1646488948407_0.8481765849482654","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3809":{"name":"piral-pwa","version":"0.15.0-alpha.3809","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3809","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"206c349aa7d52d3e80f37ff045baa192859dd709","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3809.tgz","fileCount":40,"integrity":"sha512-CpswNlVSfeTpZQe2zCS07T6TKMGCxB9cdFKdBB6Kj0FOVZoC4lZ/gGz8R9Vhs0cDLIbYAx/OpmJ2X/vqG/HuUw==","signatures":[{"sig":"MEUCIQCwR0EbAeO02IoVllR+5rise4tvF6xP4fdPaL416ygl0gIgfvHUawoKRHm6cn507XLZDRWrXT1bkVaabfs2VpjgUEE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJIUdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQCg//bgbYZZLq2X2FYgHI2+ojHySA8nnn89tjB8lW5QR7S2Xm37of\r\n1K5b95fZz9L4PSEKZB3R1rzOeu++hRDM8e+0hPZi0E9u+qGDVLfkh6zHIzSE\r\nitVM6yL0PvSx4GJIuh6jj2PpITdzAKB9lMbk58kk/JaTiYlrT97C281IYf0m\r\nWYzKOfZWI8x2+DCMDwj7dPV7ppQy85DCzeFlmfNjFVe8LmMUFZBfaxug4hlT\r\nRoYDypEYMLiEwnZGZtuXRjE6McOBCocjIcz2JHTKfVXY8l+oso92+IqDE9Ta\r\nYtPS0Itod8//wa11TSDCTm3ubDGJJrlzjNfT9tFeNqic/l6Z7hg5kqSSORCn\r\nPPbPE+ZRnVpfqEOAPMG7/i6e9/J7cJmYGRKd9VX9MGUwdjHh7MiYXq9bQ2JX\r\nCqpsdrWDQvP0xBShfBWlNz9JIkT+gb8UTgJwOOi3hQjmz65GOTF+zsRxdW5Y\r\nQPHYQKZFg2/elmJp4RLcGyilkgNxPgtzLMg+8ZDh3ZGPDdnCPj8FpTvdMUfc\r\nDw74HCz3lBlfo3uLJ8/zVZAlz8KPfT+z241IArVzAAnxZ1j2ZCdrfcNdFN96\r\nIbPylwZtayG61lSyOcmrgGo3ddn1pTbljlYGmI5r2SFRAnjJUg8IvMyQW8VF\r\n4iYJwojtIhDR3qohS5bTR7Kekl/StTACarI=\r\n=FzgK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"e26067cdcbbe90ff72d1d0815929655c05126e3a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3809"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3809_1646560541078_0.1983110250453799","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3816":{"name":"piral-pwa","version":"0.15.0-alpha.3816","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3816","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2708c08c6c8100c5383ea14eb227ea977c68a924","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3816.tgz","fileCount":40,"integrity":"sha512-naI4t6VwIGo3apE+ZCz22s3si+NUHEKEbLBOIUQ8JR32X3mKq8vqqZW+5L+n9aQRx6rZ8BLlTJ1tX3ILEpbIBw==","signatures":[{"sig":"MEYCIQCReZjgKfTNzzB9MsvayzEDcGP8lET9hC7uXjGEFw32XgIhAITxTUZOXLd0EYygIV9b+qudUFgLg8EWaia/jyAMNNTS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJx2qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvWQ/+PQHu5JexiAREZILZY4ZiR7J2KMTsrNOwJMVu/HBCaLnNvpRS\r\n6afx6v3FsRWGetS5ubNUILrfTr2eSqAQ+7BktIPKuw9mES/Ne21r0t9L7pDi\r\n0Vh9MfsAgyKkVCl2u8wvu55J83+RIqtoA72crnnEDfSknpJoy9OFFS1cq81J\r\nBqZ7LKVyL9VnZ4v5AqVKTKQeyay6PRZqs5lqyP8dK+DtPfUnKR4/ihVW7R68\r\nrMbEk6Zl3beITSJgI/cgWM6NHA7TU+SbkLhE0O59hmaOSW9oTD1YltiJiESV\r\ngL6/+69erWgFCvFNmPEgDMnGSfqkMPgday4zwBiSAuN9wFHPk/M3cFdF4b4L\r\nEWGZS59Oe02nLAp0EbZsCnKafcAB2jc1AwsFCHKs3yDVgUeTR8cJFeJ9VH8U\r\nh0w53OSfl8YxfuGvt1RDHHZZVWutxocxzPEUUKW7t5CMpxbxOFjAytWFRnno\r\nk6aWgV3naJELurORno+1WwiLtGklx93sCBw6JDPkmuFazCuqIJ2pGFZA/ye3\r\nbxRw2LtOm5C4FCo4rzk2brfcuzUsE/ObVWHmWOkSMoKJ7FbflvbHW1yprdDp\r\nBOMQmYO6+xWZgzojgsaaWeODfouHozelsFMyo6OIZ9EfRfHX/OC2+RIhZHWk\r\nrI+4Y9kbfShP/FYOcYhmQQVpmW9KsIAzjXg=\r\n=214p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cfd7ed44c6b73655be56587aeaf774692e0c94ad","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3816"},"peerDependencies":{"minimatch":"^3.0.0","piral-core":"0.14.x","parcel-bundler":"0.14.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3816_1646730666012_0.15555493902892792","host":"s3://npm-registry-packages"}},"0.14.16-beta.3830":{"name":"piral-pwa","version":"0.14.16-beta.3830","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3830","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0e7a62f8b94aaae04d87982e5de143d85a515b14","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3830.tgz","fileCount":40,"integrity":"sha512-GHUXzA52yAMuraDHPnj+A4dBv6U89v7dGYWL+68bHGjMy5SvZFXPWul3GwlQD4c4Prk5N9DdJK47EXFjgs/2vg==","signatures":[{"sig":"MEUCIEkNqjejyms956IxuXd9/ejwXKDV1PwdCnqglPn+92oyAiEAreSiVIdV2OF/2WBXjya49LjCIhq3XOebsszBWumcVR0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKNadACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/Aw/9FBZ9u0sp2LxebWDyVd+s3RFmLb0iQ3yKYSmDmR4KEqgxuBp0\r\nW8icqydhrXMH/yh288XWX3HkbVZJoLcS5YH92P55HFzIWWmy8WqPWNB1fcfv\r\nQSIYe7VfK3qqkJ2/fg3KrXTZbPxJNt9MNDwQ0M7A/HVpA85kVzGpGVxbjQLA\r\neaNAa8W9dNskgF+CRPMQbJ1bGoXjeIGPksMHKjlLZJOuMlg+2l2zsikr4FvF\r\nSZ1PM0zwsjykHh1tKoucDLOOxo713uUM2l2FlmZ9tfEE55i3O1PWtwyT5eCF\r\nfZwBlUklj4+EepEcSjEcX1S+dc6wD6Z9YAujbBTmPM3TdFehkRSB4TAYzHCv\r\nmAtf2QpA4ofipHH5RPZRURPMB7T7HetqBbcwWYYn92RlET0fNr3WHXqnQIo1\r\nVZhktjRQKZJC5NRDemo4p/3tvPq+rX0C/OBKQNsOU/Va4OL5AeV0/U8kZ+Gs\r\n/iUttHFVip7wiZVD4qEeXf5EAn+33NTLmFcBF1n0iGs6k/khj5cnnnD5xcMJ\r\nKmeOSPvaeQksHZEEmMrbMbwLdAKlZSrfmp0+E8RaLsBookBjtrHOxBoKuN0H\r\nwrGx8FCLLGsBnmOb1NhxA0bOS/vlcyTaKm/Cj0dqQf8K/YtJ4PYwZ+koVpkb\r\nhdfXn/nVBFFh0CUYSmjFbGY10T+Kaj6cg2Q=\r\n=rQmu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"93fea0946fbd6fe225116631770667613ba5acd3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3830"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3830_1646843549630_0.21147226787347861","host":"s3://npm-registry-packages"}},"0.14.16-beta.3834":{"name":"piral-pwa","version":"0.14.16-beta.3834","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3834","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d28eae38e84266114215b647c2e8113ed9e657f7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3834.tgz","fileCount":40,"integrity":"sha512-E12JV8Az8sexWj1NfZ3HzmFGPOlnpYGl4OtGisB7kYVEYIQ1Bc89VKFy4UdcZGlwEtoFhMwW2XgFmKrkknOozQ==","signatures":[{"sig":"MEQCIHzWLgrN3Tviz5W1l/er7d7Vg08f4rBxGefeS3Wd4COOAiAtKWYxBY33E3lQGp1IX6+0ayFB2l3W+YRvUdbOcmiNRw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKc7cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7QhAAou/YB0jJZF9p6x2VKNX08+L9I32Tqyu0yiFbZD/vUTiEhcqT\r\nWQsDNtn6VYNvVAVaj7IfLuen5vyq6zOFULUqEk3NIxr9V7IdGrcCsvq68EfL\r\nIBBi0eaxOZpJGDrARzEFxhY2BJ04YRUiElfqlp+KEZXcjeN7amappXq2r7Rm\r\neIA2C8n9LGeie5IOlvPhULaCTrUKwanxJjEsL3zd0QZtDqVg+toLP65NMkzc\r\nglzIM/yTA88AqevlplLHV+i/l4tglBFYAlNE6zcx44G8YoKJSCm+etiLsbf+\r\nEyevAjPUkA6K1METlLl9Oj5kmCyUykRX/zau2BmwKX5fasO/uVmKDnevPpDg\r\nXImwdqWL4zpyHGfmUuj9+l7KeEs0WsFDeKZM2+LEtFqueGDr+NaHR2E29dH1\r\n+Ivvyy+UW8a7Nhpe+u0mrLIgiQeErnSFbj9xryahB4GX05Iah/aRffuOsqQ9\r\nYAX43dx4w9S1B5Jcr5JRq817tDvyBJPxTnT9DEy9SoY/FjCtE/+l60uG3Nc1\r\nmXB6YAgX8t/R09P16raZb4uX/7V/7SUrFlROCQkgg4DNrwIbwzyus66Ppx14\r\nRizL1vuz8I26j/2IpFs4IdjWsYOBrTgDiIs3xjWJnPEvmYoId4+RcmthkS9k\r\n1eywKqbNcjvk5oTTyH7abf+CLJiN8tIYJtg=\r\n=IUD6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"dc5add5acf100adea76a88895ed80ab6f5a03c97","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3834"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3834_1646907100574_0.5987211850153249","host":"s3://npm-registry-packages"}},"0.14.16-beta.3841":{"name":"piral-pwa","version":"0.14.16-beta.3841","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3841","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f1b713afb215dd5b26577ba000eaf5bad6bcebd4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3841.tgz","fileCount":40,"integrity":"sha512-OBnUzVo2VPitEbzd24FmARRKVMKD2pxQyMqpJmvgTKrCPCyKVPfxeiZ0kgqZsy0c5s7pfokYt60xlTfQzzn0rA==","signatures":[{"sig":"MEUCIQCGjcUR8Gxd1N1zcSyRHHA7HpcjF4fMutpcE2ee8Z3eHQIgenRRMnx1hW8CaYBzdyQyxL6H00n09YzA6mQfbw4CiP8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKffHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYJxAAn4JcBAv+weuxb6pCjXZSobyLec6HLAj6s4lKTeBoDK5fy0Pr\r\nIJQkNlZiY1EUchDZyiRMXDYOh7pu5LddPFvf1kSyobli+OxeSWXUKMqMjId0\r\nsKObo2gl3zTsVyG1eJJbF/vteyQXYWB8gCTMgd60LX8bCWKfREfYkmszsxHg\r\naeunvzP2+wGBJoj8/U3xQj9jefYJubIML5Dacbd47QxVOnG/onJUKnFWUaBZ\r\nHn2E8hc6IeSYeWVqHA1PEUcfglrTcvGvWXr/0PkJlL+86d5/qe6Dzik6gaZo\r\nZi2ODKu0RMlR2TB42MhVJbMsSbxasccn9iOW8K911jpD4n91IArrst+AJOH0\r\nMXZg1fZhrA8MrxKXLw2Wa/piBgCGqS74Xqmh7QTj/WBDqX+mg4SfBobMsOv0\r\nib35CD1+guhogrx7JK26I/UeF1vMvObxvuI5L+FtKrE51qPxceovEoSbHXtp\r\nk+CCiaNolV6O08AU3MxO+pMHiUdUxg91JbuG747TDG42L9FuYaZIrt49Wnn6\r\nPASOl4Mjcl/X9QqzQNI/ojDDl5CRV3Gl0Qh6HJATrayo3nWhx263c/0p7Lia\r\nX83sknHxvctxNzLdWOhg5WloVGBGwHsJjIoJQrq0NvAcbKGxJ3XI8Joc7SqN\r\nma6akHiqEE+7h3ujwGMWmnvnfe+m/7+20ss=\r\n=0OGT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3841"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3841_1646917575060_0.8255078575347903","host":"s3://npm-registry-packages"}},"0.14.16-beta.3852":{"name":"piral-pwa","version":"0.14.16-beta.3852","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3852","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"90480c515aa33d54bfcbc7b161089862945f8adb","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3852.tgz","fileCount":40,"integrity":"sha512-iV6wIPrjP5Clx7wtKD/UgRNOSjbaYv9Q8Ipwvue4bsW+fHJB5PL1owGz+nC4XCxLHN/P/umf3k0Bsgy43n+WVQ==","signatures":[{"sig":"MEUCIQDQtDnCio8uvg4j46FDFXccMOjUtu4KoLzm3ZdKjXbQfAIgTnuF/6q+O8OsdOGO5Dnfa5haTIcJ067GXCPRq3DLviI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKfsEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGXRAAolNhvUX0/RWKLOm84vgaGVq8TkMLzz7YDhKivx5wAtHxPGYl\r\nF1yJ7D6AyvaAl7hngmXpfS2ENXh3Ho6GGlLhntNkNbqicUqBuyA2e9xPwyDr\r\nOOaqaZWG+cacDrNJ9IKZLBe4fKvvgDf6yEbePyCl4/fR32mBDTrSszUdkpOn\r\nGHeDvAtAa+O1HP16GUGALlIyAuhpjGA8zeGIaspSnLmB4/F92SH4TSVfUhEm\r\naiErxchNcMyd/BOC14pzDQIQN8LW6cl5lJoKqfRMOoxjZoUnfddqdAtrFiD6\r\nWsjvlCjhcg3JM08AKAHj+M7ziewgn/eRzeFi7gTSCg6Kd34cFa/dbG/i1VNZ\r\nHgOYVUayANizBwi8oKqBEvGxtHyX+yOXyYCq5yeJgP91siO+Xb3h7cnJTprK\r\nOFJGWI3BrC150L/+8gPetYjBtyXw3njxrbBoSvMuWGx1+3+fjaJTyI4cgdTY\r\nb3Mgq/ms5fZ+S1GImZ096XRcVv1fMKZ/PUPm/A1QXnm18Z1dptueUvkXNdIB\r\nQjUaM31duk5ffn+XujNaSxrVU7l+yGbXUYkoIvhjNoLo0DU8ehVjZ/XVbzOf\r\nUKP2SyoJl/SmhDOsqf6bEb8fkPrnIqArEHasCsW/de9Jq4n0zQvdp0t0e3e/\r\nEQKoWe8uOWT2FF4TNmXBQcbB8hDmz9Yh5hk=\r\n=CEPI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3852"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3852_1646918404480_0.9991803271095332","host":"s3://npm-registry-packages"}},"0.14.16-beta.3861":{"name":"piral-pwa","version":"0.14.16-beta.3861","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3861","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d026b4dfe7d95cbd24ac732b99628769c9350e11","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3861.tgz","fileCount":40,"integrity":"sha512-w2miDbhhg0K11Gx2m/t8eF3y/Qv9afh6drGsd01ADrT6lg6GPcbT246lMTWOl00hxng0NV1Zb9/2T5u1SrgNFw==","signatures":[{"sig":"MEUCIF8ggEAGiixmTd3AJn/sWqNLbGqOeogH5hqS+lDgeWSpAiEAwH9xLWbe5DOdEUG3Y6R43Dn1S7UceuCtx9sFqN95Svw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKfv7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQcg/+I+YTzay/xLFMFeI7BKmkwee9g9Yt8nVoGiVZ0YsNGW8HLALF\r\nVAS6q11j5bcJwUqZRHWM2zx8C6dbBzUsiE80uuMwgC2LEmtRK0NQu95bLYnz\r\nDeBGzUgKLlnz2DBKGeiaSTBhy5O6AHED8vf6Zet6/2t6CWpiYwdd5bMVyyJK\r\nEHAb7T9f2hRvtW6l8ubhnIXtUERnJ4+IvsMwM5NqM5F7RG4gKS2oSm8EEwSQ\r\noNlZqlgq2dsPJaqOTN5kf+1tgyk0H9NITJ9WE4miPbnvljWQjsbfvQWMxL1S\r\nBJNbUSI8TJOGjifNQ3+BDQxBBCvqrvigxDXkQpxSP4Gq+DLXNiLHNL9MWrBN\r\ntqRvbhkXbTK/v+Ya/uofAcMYIEnqJ47YiDFDUBhJD1HXmAVeUePeVKuVL7mN\r\npRYoyUEsJA8V7K3ZjWsYbVe0LaQK4an0yqxzii+giscShRscHx9FtsqBooi9\r\nivZDohR0NnkBrSejmHIdi5asMPJ1IW9sMlqGQeoKsZavdqBlJECTH1g7YbQ9\r\nU54rkkhh2xUOSp02+X+0UylyKOq4lLiYndtQitZMKQETTsTu3xJoH/QcDVbf\r\nv1SORGOIv27utSOQ3JN99lCMcV8fjU5xohrd8Mxwn6AxLgw2gwEOXQpq+ASY\r\nfjvd79/rEWWeO/7NCEgcJWb1OLZyBQ3N9rk=\r\n=zMcb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3861"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3861_1646918650978_0.9446081890015043","host":"s3://npm-registry-packages"}},"0.14.16-beta.3846":{"name":"piral-pwa","version":"0.14.16-beta.3846","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3846","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"942a9e34065914b9784909148eb447bafd41e4a6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3846.tgz","fileCount":40,"integrity":"sha512-EYHSRNHJiWSuZKWa1120Qe0Q0C57DfvJh3rwTyebEFzZ4SRumlh+C76bP6SF+93Mf/gMDxOCRICd9z9SJP0HQw==","signatures":[{"sig":"MEYCIQC3unwfnFON65hfNebuZ6RuD3IrnVLuYB4Gch6oKTjW2gIhAN0opuLH+aBWfPRvFkPyJ/zuRPXHj0TGNGoy81Z8nsyx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKf3gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8zg//XjKGNDdxtVi8YHAbvUaX0Z1OO6Ruq3sJTlu3tRq2vZmV6lEw\r\nRPiXCiK5n0fLQXrcDU7yoZc9Dlat00Kwo/mFVijOqIi+wMYoy7npp1FBohD/\r\nVi+qWjY1MJrflNvqT3rDbJPmExc7zO26/HHlGdaJRGhK/XJq+zwBvEukyzMD\r\nkJbG7Ynznz0ASP4ERi7GgwUmVx/mMFiNCxiepUcnbnvpWeOjdW1X3R8wb5fL\r\nqQ/tZcIu0+5uFvUdR0EflwM9mhS4jjbhMCPpS6VwpyugpgMsw4rQPeIY9/Wq\r\nMoidqWhqF4nTR1JsdrFLWUQ3KxBtSYFgqQm9ZIaC5sxvKswT2xkJu9hKZuZg\r\nDaid6HQ0DNw8f9E6Gv5gkpmvfSgIMFeELCXv2ZKY4qluT8hkY6VlHtVeVNZT\r\n4scB+J3TOe/vSVLw0oU//JhLo9qPg+EDR6KzTbA5PstoIBRY7UVkp0YUOvMt\r\nI29s8zwyrQYvIEGgv+DQtEHJCyNj+SiAuYqYqt6O28a8Q6DmRBn9Zo9O6tAF\r\nDo+aSypgSrU+qFUji2pXT7xKlz5HddHy4mE90MurtCE12b7gz6A1gzW746wn\r\nK/wX7VaeUEm8cxkrGHRiQN880OF6/nEqR0MLFx0v2VpMssWgRMXg6W0cenub\r\nFg7M97L6ICmUfj1r1N+3fg0oZqctJcqlLW8=\r\n=sH7K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3846"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3846_1646919136337_0.9653654126565514","host":"s3://npm-registry-packages"}},"0.14.16-beta.3856":{"name":"piral-pwa","version":"0.14.16-beta.3856","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3856","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"40a8a318b16c4af93fc5522945aca0bdc9f8ee35","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3856.tgz","fileCount":40,"integrity":"sha512-o0lfC1SJpsu8mrocRCamO29cmTuJPNq9hXwmWnNMSKmqb7ZC0sf9wG3T1kEMnQI5mTcLJJkynMr/D/cYazW5/w==","signatures":[{"sig":"MEYCIQDZuJP9abJPZAu5q2G3vw11yF6MIeVm446cxx2LAV8qegIhAKSDScT+BdVZNRrYnEY3KTQWZiebmynAiSNHpXUnvKHQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKf8TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJ9A//Wp03hg2Hz8wAK60aOQjM8LRgiEK+DEEAY2NvJdeohm5z7UvD\r\ndgLcl+L3q6w6xIYP+kJtR+k31rexWmCPUBz8jEeBkKId26alWXjAqp63ewNB\r\nLccvEGYnokLkrCq+m/E5pteXvfHM6sbklLT7dCjhcmaCBasmZCp1Xns2Siik\r\nMswSc8TJra+FdSRywnFxi/8cXOzyQ32pP1xnUF6dD7MYpFGv1esUh4XQoQxz\r\nZmBlsvlzQKQKgUQQmha1URvMrMczuk82j9p9HHSxvounHfy4edzaUaK2RUPK\r\nifx2lbuLgPeIP5OZLGfI+Bv5fQ7tvzcA/SMXpndkwrh3XRWIaloDYNDHUxN3\r\nDp7dUPya3QmGzK87MQ4nEpqWha4EfGPERGxwhnC7z/FfC5UhM9qBuONrUg0S\r\nWSik0gJwhRnPdBoev+seDzViWEoNJMRf9CKtMFzkcX570/U7refILDMWlwJp\r\nS99Z+vKHlS8RwF94pmKrctGY73b3HSLArvWYOkOQpfn3bIUxbspVZrY7fgKG\r\nRkQN0U0lrkucmCw5X17rTUtJ2Ib4RubezPQRMYZSYr5xARIugf6kH7LiI4jY\r\nlwKg+fp5ed5IYidL07zsSkr5lUhYOpFkYtZy28F4dlYj/Wm1EPOrbXuKVvrR\r\nvC7/iILX1WNGp7O/yw0eVPQiYTPj5fJbKeA=\r\n=anYW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3856"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3856_1646919443178_0.23658129502145386","host":"s3://npm-registry-packages"}},"0.14.16-beta.3843":{"name":"piral-pwa","version":"0.14.16-beta.3843","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3843","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"08372650127d37854e791b7017cf2afec51b4a51","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3843.tgz","fileCount":40,"integrity":"sha512-Sog6qj9EJTjZaz1tkALDlXPAIkLdD1IQg07QGoEwc1bksauuYXKAymChhTM8FikUalbw0lLTXDfNXA2sFPqPVQ==","signatures":[{"sig":"MEYCIQDc+1HuDdYVmRqyNPTfBUUuD7wrD0Rf3VRGR08qLilebAIhAN1fq4UUy9Lcmky7NcUuRybcaScGpHWz2RCls41PLUdS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgAfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+Hg/+LK3CvS4e1ne6sEb/ussoesG8j1xWQ92UCnEN0dAPPv4W+tc5\r\n2hZFr3l9c+PY6+eGVybVUhuye4ocbT68NLX1O+8QyiS9k97YE9EQQa3h0PaW\r\nGnNweKtmEvYHhQl/BCZVDoRnFRYJcrK6roJaO0TME32F6Ss9PP8xjNMVlHV7\r\nrOt+w59IGWnj3IsnpDUXAy+knaKdRH+MVoX+lMoP3TOyOTuT2Kj5VUM9FzzX\r\nSFsVKKqZH6NuUq7SDzTpxRHf/OsnSNJO3x0z9mZZpWiu0/sahysZL5ctXs/K\r\nYUQvD4t2c3emO0N5b7tEbpbJtAK+lb4Al3oVAXFQnHsujoquicURBMumBwHQ\r\nzjciQ1o6MnzKFW/iwTmQB8MMLYHTBLRX9NUxK2YszZjwbc+xG+qet5Ex2sOo\r\njfocskPlIPJDYZqVMU8YUBg/N7ILuLuaxkP2fevwh9P7zHAO0atP0Stzxg1a\r\nDo15l12EYej92XzNi24J4KpHb9aUUUzLckB8WMFJKcTTf/QncynX3fbuv0oe\r\na8/kE6yBHk727mnG75qlJUdMTEp95Ijskt7LugL9uF6JpF8bKFZqqHdJra7R\r\nOSFBx2Rk0pxWgc5qL1DBQJKnYJv1FY7mtaYCfhyqlKDEqZ4Y7ZDHgfhlZgQm\r\n7MO4xbILo7XeJdjP1I7uBVFasQgMCQUOno4=\r\n=qVhb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3843"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3843_1646919711314_0.07741852068173105","host":"s3://npm-registry-packages"}},"0.14.16-beta.3850":{"name":"piral-pwa","version":"0.14.16-beta.3850","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3850","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9bea96983f4af6fb73a185acc17e74bfd2664389","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3850.tgz","fileCount":40,"integrity":"sha512-9Djo2/buL0PTrEz4SUwl8PNR/2bBpFkXac3CAIna7Z2+STNz7K+a3dUygrSUoCPKPwym85kEFQM5XrlIB2mt/w==","signatures":[{"sig":"MEQCIHnhQ5778DgbK4G63MsspftdQyR42/avUNQ5R9TtbuxmAiBnK3+p55RzdYfJPoyCh5DsErUM6WQ5/867lDCDdr/Nlw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgJqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrqEQ/9FRr3y9xjV7KwgGjW/jKDH1aV4+QNuYYvVgqExMbZHCDDfthd\r\nZVtdJ0zd9x4rGWyz1CIkG6HhayJ+Cb6oy207bEQbExrv+huD91JWirIzNves\r\n0n4N/DEXHbC4U8/SZ6JDH+GlTXwqd4f2VEBUKSI7P0oOKgi4G0ev6lFxclwi\r\nXacsvEkIKm3tJ/x0lIwoWwKRrm3xNPvhVWVBGBYmMrOMuljA7rCPLyXH7Nd8\r\nV+dabTAAbYidhpwICAnYgZ/7LknTbEWBpQFxkZ5JJL0/G00EjsidZkME2dq9\r\nIVQtnys1vqRJrYvCWgEXMWjUTX3WSaantuy4TaUGcSm7DAOfd+l7kfCuYIPE\r\nb2lb/abkPbntDVrXem4QESfcGdH2+Z6zH7RL9EppbdQr81eeNake+6wpR2EK\r\n0HeFn+VDsgApkmltPgp7JCEKhMrrrFjlsJKweud5lqaEdg/+6/oeD+Y925IW\r\npSl5NiHgalBDx6BdnYaIm5dvsVQhZBmsqIX3HyAVhCVERlUcG2DvwGu9lYg/\r\nXz7xczhrA8Bkv4QGjsef85vx43aXBlmKUWTy0YzVgA0z1RNrtPW+xLfOnICf\r\nHHWJccqjdBWz+dkaSD/fsZbTkHxkjvlFDW6vK0xfHIObE0rsbDfvWCKR6ikq\r\n15VLXC+pgE4scG6GBj2zGjOLGHqACWs1R7k=\r\n=tfuh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3850"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3850_1646920298686_0.008520691627565524","host":"s3://npm-registry-packages"}},"0.14.16-beta.3860":{"name":"piral-pwa","version":"0.14.16-beta.3860","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3860","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"017d09d06021a0e193d844bf5d33e9a91772df40","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3860.tgz","fileCount":40,"integrity":"sha512-vgajt9oJXWfC7zb13GwmweoDTq0lU+6isNMpqGgrW6dnoYF8/wUCV8HucZH+nAMt3KKlahvvEWPA59A+xDsa6g==","signatures":[{"sig":"MEYCIQDNL/GgnT/1CJAjyi7OW803TOMnis1N14oVOKAeQ/A3dQIhALXREZyBwLtMUDwkCEPFbHAn3M2/N4M6hkrWbuwS9R7Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgOxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPRQ/+Jwmj8deUALVUvdIHWNQSH4vaYbQr2BzECGmh2W+Bn+b96oWo\r\n09NvtpvqOgDfCDl9KMB2FiCD7lVwhTcsZcv+Mmv0Cm/tBZPRMfRkbsRh+fR1\r\nPSyJv2JpSwrhX76kUy+Gh/OJudoO+GpJ2iPbwYRnQ2nngfUlY21myvhARtAH\r\nFSx7lwdFzhfUlRAWUByv5meN6/0rfDVlEOz/IycUP4ydjV5g38Qg/9N1Mkqn\r\nkCa0OmaV9giBVaeuCFc5Bvg/Iygza6IlRI5rFdqFJbf2V6EK4MUJKhpL+KUm\r\nsTYT2uvgJsgj9RjQ1SRBwmgz2x44plELWr2HvFLnFDP+gqi357gbIiWWCpO8\r\nW+K9voqVCF6gslA5muLwreWCzwsGUfuaZ8h4XTVCQyzuhIQkRdZkv42i2RR8\r\nf2EHdat/iTb851OwidEPANuhqXhgdpsvKlsQVMiure3HkcEoxSkJpFaB18c5\r\n1eWD6Giutywuxjfl1wAJcbsd1K0TqrK/pCLpR+1By07566eIFt1XRFrqfeI0\r\nbFXwfC5sDwk2qIeEX9mkq278KnB/pSYolMX7hwLNAfrD2UylYWwpZgVEDqIq\r\nUbXxsJWht2bDdXYJFHd80qpu18MDVQURJ/o44CKe3+cR8iriR1aSYt+9KZM7\r\nKxwES7c9zoEooUQkOQMjN9G0GM1KpsEAsoI=\r\n=vMOP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3860"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3860_1646920625506_0.3588699162148725","host":"s3://npm-registry-packages"}},"0.14.16-beta.3863":{"name":"piral-pwa","version":"0.14.16-beta.3863","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3863","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8180b887a9a3a082c251ce3baa03fe8661210717","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3863.tgz","fileCount":40,"integrity":"sha512-re1SyVaSxaSxUKGN/HUA9z85EQ+MFdmRRHK7SnCx4jnqBVcPPUUPKJkhDqjeW09LDqXwiaqPbi2+ZwHmlVvQiw==","signatures":[{"sig":"MEUCIQCZhkqt9dmTD4O9hmqgtHdaevF/4A++CTmmac5TusZkVAIgDQKt4sxUTaAskoYVyIU4SpZPLajkY3tdNu8zwY+SrqI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgTKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcNQ/+KsrZEsG1II0Rvl3/XRVaBAmPIC6MWValDC0+rHSQQYiGhkv/\r\nIfJmm+Bk2Q0T4ss548Sh+Mr7XNyqfR+yWqLQxxlMXkhFW+JeNtdKbJw6fFAj\r\ns5H1vrTsaIr8d8VKDqmZBzCgVfXHVJdyWquXQ6QZfbNFf7J4HXwZKic3VCc/\r\nrqCUMqL4g/RHZ1rf6RfNlCNsbH6c7eAVFqDRUngmRYPBVHsJUW8pvVkpV3Wf\r\nc0U89wene2/TRCLmMntQXGLzISLE1cnFAIKQKgO2phrB5FzFkEkstUliZhTD\r\nrpHbRVvW+a/abiYRDisoDYlfG1zeShle/vxDRYPSEJjArLFIH4aHRtQh74G7\r\nOVOxNyuRHZRzotIEHtDhS+LfdI0aGP2ZiSrx2tB+MxFEwzCNTKuvT7UuMW4p\r\n2w8qXhcIa0e3isd/YnTX9mdLZxSkcZ1ryJjaBPzs8UIGW0rOo51FDR6+FiAU\r\nvcuX6pBgH0ep0k7h47eLjOFh7lbVOqCpc8I9xZxXhgxt2DzMDTjMXoPl6OAJ\r\n8XQm5uK90etU3QiHA0sLeECs4B9VcF9zRhus2oug2eOdPuV8tcdjJxjenNnv\r\nTUTEK+2aSls5fCXycT7AboXSXw9X+kM3q9PyVbv1h76m6pI+9WgWvk8PmDxP\r\nEIPP00fz5bx1aKYOdXXgQrJfn05/xW3BT88=\r\n=5Bc4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3863"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3863_1646920905876_0.06731869969283255","host":"s3://npm-registry-packages"}},"0.14.16-beta.3855":{"name":"piral-pwa","version":"0.14.16-beta.3855","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16-beta.3855","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"41fe77f769411405b72243a3f99dea01fbda723b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16-beta.3855.tgz","fileCount":40,"integrity":"sha512-JrgmAXJe+/5HNRCLuy4T2oCrZCKIYzt5Zy7JD875uABw3REt18P6fOXBO3MPthj0Nr9/qrG4eJ0GNVex1Meu/w==","signatures":[{"sig":"MEUCIQCyJeW97skBXcR4v2hEpnjn3Hs1rclDs5e9KFl3xGc/EgIgfM21ZZBXh9EvTt0O7/zJivrlZpCly0zeWyCvK412DZc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKgUOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/6g//cmUjTw0Z7eCPlpoOgDR3vxUUPMHLyUGQdeLHB4cp60PkVTqK\r\nlTHaVwkdZJW53K8Hj2gOM9C1hb22rGYsngZNgZaLW0xkbliBFobzV4/RH4BN\r\nPd0E/fRUIYmWoGNdm/7h+I4r9+2hX53x2EXLrLBEThlk4MgFSYk7bQhxmJxo\r\npcBidWu/dQZXE4lm+2jY8TnlNCMz6MGj26eh/ehqkUcOkGxdXKyrf5jNlJRf\r\n7MCZElCVXX54ok78+Ie4ouVt1gTHGrR4lDgtINyRWHeL/zHmuNJE226xL8pO\r\nZfgRET/3+jLtHht7dPetPlEn7QLEPJxsyR0tzd7RTbQ+AE5/Jx6edf5Boc2d\r\neCyTnF3hqOdq7NSBn5AWg6ar4TarMFGHeQh5Tk+iOTGWv8R6NDDanguPc6sm\r\nNUotOwTWquVivCXGBGYBN03mVy+5A+RHmjZvPJixSKJgUguxDRqT37V5OsYp\r\ng1JmIeMZ0qBEwk1y4fCLVona47P6/5Z3nUea0QuAJ0B6I7s9iSvZrZpUrAco\r\nu5kft/UjMuOyvH7Hbqp9cXCJTjQGJR3oLaYBaUNr+BpHs1uGXmTeSzUcrh0o\r\nJRfeOvYJGoL6eCrwnE1bOtUbnqpujiwyoGy56TK6o2Sf28VXbxyGwaSrM5rz\r\nkflzeucXVg2NWTsRB6IrpKrQtDZ+hTFykBA=\r\n=IaKh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cf50d08d609be8b025664f4e6ba45850b675aca1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.16-beta.3855"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16-beta.3855_1646920974662_0.18784083921710537","host":"s3://npm-registry-packages"}},"0.14.16":{"name":"piral-pwa","version":"0.14.16","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.16","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3ed9b42f23602bd22c16cc18455cf1a3b97d0f74","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.16.tgz","fileCount":40,"integrity":"sha512-lpZtvU2mby8dM03BujrpKFeKk0iALPm3xOGrQBJa8DUzZXCbXRAswNRztau7Cx3so3cTGGhpGJvPm5rGHdbfpw==","signatures":[{"sig":"MEUCIQD8gvbm1S4uqwTbcZTxaeRQmsuM42AzEbmw0r3LPtb0zAIgJMFZbGwszcS07qzPQx5Bounah16qVxpNeYNdavZCMAw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKhi/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHBQ/9FjVclE1OnL62wuNMSbGNOxKeA96kxcdH3VrmO6+RJr7CVqdf\r\nrTtlElUxthAIw7by6XuAhDNECAi5pstlBTMCdDZsYUZgGLdeoeNA94RoF2RK\r\nQQ+RP+0T91cC3+WjkfxMCTZmLrmlIMYgLefaAcHPphsVs035Al4utrWXhs5m\r\nnn6XqihAze1hzEw4BIJEeBvlG9FG2DhSCFcgFc5jWlB/Sox9nTcBb1qt/kr9\r\ntB12h7L4O3IcY3LgcAEIhOJA5TS4TyNPHePg4jeVJJK9ke5Cnuke/pGb6f+w\r\ni0KqzZo418I4IHNfT+OiEejyA6yOrXLTuePOQoo5gzI0qJaxVPnwcpHkKBLG\r\n7O592TlRbOaVwcy0pcHJrheJGNdElZvT05+UnKnJYuWpB89pMUsB96oFQpJc\r\ntCkl50eNaLblEVERM0EACt6l+30xQDAk2HxKpo+tlVa8ST+vNVXl6I5oUXrC\r\nKzZNQinE9uq6HPrZWzX0TgGmhHwRaMC9OqD/N9uMqXeMiI0+CFlgTFP73JQA\r\nH/SO2fpY306rDgTCE9jKwEGQMzgzHNWXDQEQF5/IJ+fe9AMokdWKxsDio/9w\r\nvlCnA/nbER6qGDN265AT25tlVxRkDMh877OLUifYtsOJxy48xHD4KeZ+WNjO\r\nDFk+OyiPVXoAiV+nFnGFXUiyNgsiMVsCSas=\r\n=qaR8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"39ec6f4eb7b46a14530cb845371bf9e294be0171","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.16"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.16_1646926015409_0.17633703431078995","host":"s3://npm-registry-packages"}},"0.14.17-beta.3882":{"name":"piral-pwa","version":"0.14.17-beta.3882","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.17-beta.3882","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"dc68edab9d010380a6549db2206ef4f56483df19","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.17-beta.3882.tgz","fileCount":40,"integrity":"sha512-WmboDmv8yOvRn2NUCB6IypMMrVIUL2kvlU9/3KRTT9zgXeHnTlHTaUtDBPGLUZ6wQXoEKk2jQFJkQtod7PW5QA==","signatures":[{"sig":"MEYCIQCQz2qgJ1D1DEhagEPIvUOB3SfQCCHlgCplz36sScXHhgIhALRLvrGr8WdApx55bw5N5x4NcuCI4FSXJVN9fMbwDYql","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiK2//ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmow9Q/9E/K9Nu34Yk2mUR+jTBoV3Hsf1s9/d7c8HWmImueyb6JS84Ao\r\nUu2aHqN69bMMstoBt0IrXI63e8p7hFQfre/Vm45PfTRIF0t5ZlsYVz/Gg2Z8\r\nZqNafdx8btigdO6Tu3EcwjDkbBnZVVVSqrKvy7C8E2kPD6VA8dbPLSwhaFX8\r\nlaYwdU3EsUr8gUkerCPEd+teRbyWqu9SmR78pfq4oCnCsZATsu0Co3lJ5Nfv\r\nm9NRSYyp+t606azSA4kYCaNLd1uqq/ry6nwE823VGq58l67l8vxWmFOXWyib\r\noJbMHsZGs70nPfMKE2SyoBAUFB9PkES6XsnA8pAocXlj6L3uXfNGlaY6DS9+\r\nVp4gE6dJhEJl0T8GGXys2IKOJyk1kW7dEFjkH4EXz7tmXv5bSF+4+j7Mfn/A\r\n2+P24XsCR5a3yCbKnJh2Rm9jnzikzNWTwo7FsHI6DSDds6WlpuGjlfHyvPok\r\nCMT5GWBZfVRXAYNUZD6SjMecYNoW+8AnKEnqYiDSD7F8D+VNnF0QbMb56RL1\r\nvOW3pXqFtMubPsDoZFdRxJheRgDtN5bBtjT3nIQ0/ZD+hDFiixcpQX9ke+BZ\r\nZOGa33yHJkEeTpORX8wCnOfoxTTUS2PivQFu2jDAZf4CSrEkor7puJOumsRu\r\nVR0xzrKjiH+ryRMM+vhUm43Rh+Qnihazetk=\r\n=C5TF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"baa86e46163bdf6ea51d84414a6fe64a913517c7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.17-beta.3882"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.17-beta.3882_1647013886950_0.8672251968095039","host":"s3://npm-registry-packages"}},"0.14.17":{"name":"piral-pwa","version":"0.14.17","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.17","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e1083d83fc5a8cc9ffab3090fcbe2fe441df666b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.17.tgz","fileCount":40,"integrity":"sha512-Uq/l067LHIMCHc76Y73CT15OUu20fyONsekxysJd2D0YTaAiVJI3sUvXxS7Pt8WLH7dsYB3JEpHzLbzqbAGrYA==","signatures":[{"sig":"MEQCIBjgocH7W25QBIpuwtzggmsEPJ8Jc/sRRkIyMWzcTgngAiAhnajKJ65wZJVtocYvfeoiLgZCX4rE42QXmaAEm8y7aw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLhlmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6lA//XdXc07MYDUXGjL/g4WKYHa0o0SS2Dbd0WdbTx8OPaE4iUs8v\r\n5X8WzbilxHDxZ6ZISecxEW2LHlQBfp7E9hEYB/4H8/HnpMKAANpxHhfE1jP1\r\nSECP/0CAT2H58hziHr452QV4L8q9Ccaf4jOM4xCXfVXQk+hPU7lC2oxrz+n4\r\nv2hawDAnzaoeicIfY+isXUS4RikmVULAIRNzhmYSCKS8cgSocOLURsfEAtdt\r\nw0zD36dSTl082YyGWPk2c7pORU5DMqzawgBCKKA+6Qm/TUfp1WnxZDtsAA1Y\r\n1CGtBSHjXazFFTpyy/Xc/bgimZX1SE3+L0Gz5jz02VoWAU9TbeX+NydR6rwx\r\n1ca37Ju/9q3zj9mBsbfFHu6cHKvHzxJfswiWBiDpFMozCWFw+DnGRQ88n4qQ\r\ngrWz941WPNfOClokhn5mjne6iOZ7y5wwa1sELqVxUmYzWuepaJ4hmmSuAoJY\r\nNRdHIQeb7SUJhZRv0dcwLpNpKp4Yfpm5YxpSCXsmFw7k5yS5Pa0ZofRBiIGB\r\n55FuYZmelAynRxUzu4x18opq1KpMxTig5m04KjgT6Wkr1n+ceu8qXOhAoHur\r\nN6BizM8zFC+/HoLrUcS7/S45OtKP7zWiIo2JBWsvDgl31VU6eaSwWpcgFJ8I\r\n0D7KhnR+FTcmziyqHUOBN4g/0WUPbjR4of8=\r\n=9hid\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"8038b8c79e38dea9a1e0bbed713803e2c776bcb0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.17"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.17_1647188326457_0.7255170140378076","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3905":{"name":"piral-pwa","version":"0.15.0-alpha.3905","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3905","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c3e03ff5fc810557dd94631e0df6ca7e8339a860","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3905.tgz","fileCount":40,"integrity":"sha512-prOg2Ltc7dRy6HWFDwnoxp/U/HXNjAmDUSD+a1r2ot+HS3r7b3G4VXJ5pTlSQOBqwdUZ4eqVyf5kXigy0nxjtw==","signatures":[{"sig":"MEUCIQDyyNodNEfrIcxLHgOJGEdY5W0n5lIB9zd+Fe+outI1ZwIgcuJtlbeSjjSuv7oo+eA99S7LBXRP8WGccN3v6OSPByc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLpyfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopaQ//XAu1kb9v1yVZ1/cKU3SqjnXtNdCtD4/4qfl2NA5OrPA9YqUd\r\nnkxL6X7eg1bHdv+CyEVSnZbOZPT7QkSgdVKt45LcmftSOuFIAxyfm41o134B\r\nTZpfrPAFH4I6glsqGeGfkG4CDYMCbINM7A4K0Z9zDfMGHUUA27w4CvSOoLvy\r\nMuCykHl+9OGJ3fMGKXsCyMgFgstp4tFb60R/qyCg1lc8PtbamS95xcB+bD/W\r\nQoO2Ro1f+VhYRhHk8nWhb8+OndyaC6On7GxotwlbOLSkGg4icSIU9TqlT74r\r\nq68PHt4466FwXWO/OUSv0rxZEzT6JhPo5xvUr0crj2nGa3G7uI23hibHmm58\r\npupeuAI1Yufz/E58if7PMIxXyc3lmUqSvdOelRzFYDcXMH8L6txwtdf1COVM\r\nFt0fJtukrPNss6UOmLvn0gflOS9ow0uDWGY7wew6i+en8Gk5RMh0y4YsbVJ8\r\n+oG/4r96UPRVncH75b25ybUxBqNLTORZJ+DcFEfvohMleXV/mqtK4nmv0pR+\r\nLbbYpGqGvJXfr8xYrfXJ4386HVRbHZNCg6msMUDyfrcRHmKhTd3qSNIu+XTB\r\ndUoMI9/8NOQSEoWcDI4hWgN+d5ReJqeBCMW1/+draG4ufGmvEmIx7ADzfJjY\r\nd4jTyLLWqBfk2KNJFzxyxIMmc2wWe9VNY1w=\r\n=3/wB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"533d09963cfd8c901df797958ca386dbae0286e1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3905"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3905_1647221918935_0.38771823623406343","host":"s3://npm-registry-packages"}},"0.14.18-beta.3923":{"name":"piral-pwa","version":"0.14.18-beta.3923","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.18-beta.3923","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0280e40374077865368998f15c36760acb50ce31","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.18-beta.3923.tgz","fileCount":40,"integrity":"sha512-QJ/tk4vsxkodSPdAyBlq9SbXOXmDosC4gakp3uHWP3zREk0VP3x6mn5l5eNvATeXr8nmPFclZ8waapKwX60xYg==","signatures":[{"sig":"MEQCIFlYmil1Z+uxA2cqsO5UQS1wKw0CLuFj4QkMW9xPPdVCAiBEGHIXxRe2Q6ZIG6wTOyrbfot13evLUGVDNTUg8ZE2vw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL+MNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmra2g/5AWG/SinTKtQO5zQSOtLNX05jZ99TQ3jYNAfyTlXbE1nWwLqs\r\nAI6sOLwZVqoLEvSDspwMXBOUELoAl/db+QP7rAdHIQErRVb070lKmnoV/8T6\r\nqYC5YJQl4FpJ0+mR4YBPsntXKiEeikJrSRT/XWdY256rlSpfHhBkTX2MVjtR\r\nwEL0Fljvd6CuC2VkVRWZmip97QiVxz61vruZi3qAyGNCmBxWBs3Ft770t9+8\r\nWlh5icWedsdEhfZVA+mw7xyNdpfBc3HhZX3MAGgzfAt0sbd/q6/BhGRxAHBH\r\nwVmt/YwlbZtQqxv52i5kQhvZfD9JQm3TprTopEIuKN/RrdVjg1EZR7/bLe2d\r\nY1vtb7FZihVyMO9fLtdgONmuSBkCI00yuzsc6OFRbpxifepp0B9rkRdOZ5+u\r\nyaoZgPa79GsMcNqPbLdnVxEeTVySOZ//YIbVQCrmn5eZ6Y3xZP9eu3j9Ou/C\r\nu/dsWDAkPzqdYJ3V5bY7tEUCN4zD0G5rUjz3rWidJWxQf7mx6PGyDi+n2PaL\r\nXYtaoUuJYlW50h0Qxa7MmrsLKQFyhVuxQ6lOTIl+s5LUQf6Hif2ujUgjpvXW\r\nvuPCIa+BAfN/OPx/86HYpbmEx/1hFzDP8JvQTPVQzy6axHxqiHjnElzUfG5H\r\nL1nSwHxlZYcstnrgmUhM2tOS+SXPLXiHMxE=\r\n=eX4b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"036cb83c1f1797a833edbcc9a7fd698a926aedd2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.18-beta.3923"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.18-beta.3923_1647305485769_0.9919750739554996","host":"s3://npm-registry-packages"}},"0.14.18":{"name":"piral-pwa","version":"0.14.18","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.18","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fc752f97335ba3277332ee1a6a8504af760925ad","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.18.tgz","fileCount":40,"integrity":"sha512-J89+lEdfaT9Et++xxQAPL100KMSSy2gdnwhbauBQILj5NUc4q1rjUvacCnx/8SHBbJO0KLIpZSaL7vtqQjP9yA==","signatures":[{"sig":"MEUCIQDbWd+oBwNH3Q8iEuF36WQUg54aYDJhLumoVtum4nFt3gIgEQVi0utWTDmbzU6OwfX8diSNBOvSCehlZYnTyuiDCRA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMFODACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnpQ//U8tENMkR4+IAK/87/MqshDIPD8vGvBsrLwS81imMRXt9cvk0\r\nRMUTbQITWBXDxBKFZGp84lMgr5CXJhWEIh18WjfKeco7v0DrXGvnDJBfZAp2\r\nbTYVduFDPdpMaJCVlf8oFsx15VYfXKEzawXcIRLPsQy/5IezHJVZHG7HUwlU\r\nl/mwH7I3JYxEgm6yrGkcHoL/5U62W931Ye9RZw03/XdpCN2qNEbrk2Nnb7Gp\r\nh4rBBvqfduyeyr22oVFbZd/SgXm99ZOlxhptCwx0GLyZ5fz0SFRpdm87cmz/\r\n5RIg02KPBNialrrLLj2XLs3hmsesOcuOShXEcldwe0jpx67KxOqWn3y173/G\r\nC6oGsp0x/2IPXYKS+L1CrF4/bOJcOaU+4muzLoAzLLBmHkm+dcIEsvtOCQyG\r\n6C0Vw4S++/1HFGTFRoWEmCb6f0qaFdZ7duWC/YA3VwnzyH7K6thjQjPHfBRK\r\nP9nzR8ynV5030OZEIvgriG7RKuSBqFdlL5Ta4vAo8C2/0opFajKTGVrAwqFm\r\nO0lWcNIXunOiEkPqDlEYxcC4YK973RFW+LBcl53ghkXMmU80/6w8ShVtSVmU\r\neJpxXl3MgVLjFGtE3DgKBMtTIA6DDckGQ89wQAy+1QibHvJjiOaKsLd7J5NN\r\nkVZprE1aHyUZcgq5hdxuPqfe4aGEH3yVL5A=\r\n=BqwT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"ba8e17c27b8854890fda9499e1107587e641e9b5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.18"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.18_1647334275569_0.6700026317396235","host":"s3://npm-registry-packages"}},"0.14.19-beta.3927":{"name":"piral-pwa","version":"0.14.19-beta.3927","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.19-beta.3927","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d121ceb8cfdee9ed91c3d0a1dfda2f762cce9b0d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.19-beta.3927.tgz","fileCount":40,"integrity":"sha512-aK4JjqhAN5hUdzmLZ00neKV9d1sfYrPMp+M00qzjy8bbbI7m56qvpE8pTn+mDRdbFfmaJK/Jtz0CrZ74Bix4JQ==","signatures":[{"sig":"MEQCIGLtuJOQpEQg+ICA057cBbxqp97W17q5SdaIO+aVkyvPAiAs2/oMvbH8DViBxdK+ZPNRFV55KgrcjTbIv/Tq7o06XA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMNL2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBIA/+O2P/ekz9evedm4l6PcPYGMo9lSCmqhz0O6hIaRN/rLBnt5U3\r\nTVAatxG/lnqCCch+dqFvIuiHahZ6yl6y4JRUOGZCX8xB8b1Lkz4ske98eGJ0\r\nTNy7pRsKhWleLDW2c8kwqZ2bwJb/OyFo/LWsmg1eormB2SzAnSqbUVV/du+b\r\nsSc5uf1keiCg2/msN2WfcR+R+TQeJdt+urtCA3zmDmOdIMCuZrq7NN04f1BX\r\n/okT2s3HQKncwYJgHXSgzD42+BWESo+nbC0yIEkXForn9cmjDkwPJMVjhGzK\r\nAyOje9e/jJOzJsKRXzXyPNjBlgxdvPwGbYJ9BXHluPIbeuCEXI6EPUqhD1C6\r\nDlZeiauFVItfoQzUr3QCuRYvLHaisy/DisLLhoJNdtuVbhFE31LsTPkjGn2+\r\n3YZCBOUYzNeYCfnjlfAauEFPx3OJp8F7jwCr/3QKAFz9NPCFUP/4WHFwFhGT\r\nqmG8GOobxone4QUw+Z7zxvQCfW0F9NCLv9tjUqQfxfxBmHIJhNDNcdPwX8PV\r\nA++1rLaJmPkND6muww8chNP64TH+q0AQFM19PP51wVd7lyIdec1XmHMfDVYV\r\nOb/LtEbripH+9HR7983cd9mMBHI6Fvh2fczvRxQVmx4j/5ULT80xMg3qamk6\r\nn9XzeXewE3bKQP0ZrpSFkiXqzIn5RYe4hXw=\r\n=gb7q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"32fdd3a819e4397c2fa853d9c9e637153a7c44ea","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3927"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.19-beta.3927_1647366902394_0.1144688748194882","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3933":{"name":"piral-pwa","version":"0.15.0-alpha.3933","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3933","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"505ff9fac9a098cd1221ae156a702d6165e4c008","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3933.tgz","fileCount":40,"integrity":"sha512-DGZVtmBTd1+EEB9tk4Lo2DoQDLcZ0jtycOoBuIW1sihXvjtQ78LC2QKmAsiDmXcOIRetop6k8EbVyGxumCx9Tg==","signatures":[{"sig":"MEUCIQC67heKmzIZsGpIiGkFpTwTKyp/B+l2Z1+wmwM+xM0ZLwIgDzhR01fXdK8Vdp7BKahkDBnROBig/zfQd0oo4nuOcGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMbmXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoY5A//cy0TfoHMoEblNzG3OjBTLExeeL/CbcRbmHQ6mCTrniXLXvDt\r\n2fn+j5dzHzEmQfjzVA05X91dqh4JN6vHz42leWlUTEOuTWUpr1N2bMbJ/AVW\r\n/S2fZ4q5SoDjtGjlI7U44xy8H865ToDkp4Zi+bQoUNLLW+H8E+bQcGGgUaBu\r\nqL9uTy1c8wtm4XyrPqyQc+euM9ujxzF4JpAg7EPzoheuv5kEId2E+40yA2fm\r\nG9jGInTgsjE2FpYAUgJWOuFE2Km2x4+rLiEkdPiqhZ484jvaAe3v0rDaHALY\r\neeyXRaFTwMtPcPn5B2ilIUvp02Ul1hAMUYbVTS0LeSafF7mZbgdn6ERNzQFm\r\n064gxuP2LvHMGpkGLxGCaXc08XjgixPo4v2Kvv6LZ/83jvWDTx9Z0EP6gfA7\r\n6CcnVtaeOeHSbQ+X9ui2BDmzuK5REDD4ykjCTuekh6BgavYDm0BLG3ECvoFS\r\n9hR1p6xdZLQKlRPaWBbU1VdQnfdp1LQJvkS+oUGEb6DebLCcJZ5M4PCaiQbs\r\nKul2C+GRPnOJf7AADzFxszXl6QNQCng17QtUHLOATVgDZVzjAoQCSkAP/UcE\r\ns9gvwb3hm34GzHLkRg+o8FOUB0qG/OJ98yYLw/O9BXT4KOjZaZepmQKlMvow\r\n65L/UIWooGRD/lIYTLfnxTWR1MsaptbI6uI=\r\n=+HBj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"520a272d09f02543153f1d8b2ae23a3ae10acd6f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3933"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3933_1647425943660_0.5385359719409308","host":"s3://npm-registry-packages"}},"0.14.19-beta.3953":{"name":"piral-pwa","version":"0.14.19-beta.3953","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.19-beta.3953","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5dc6e5b9fb8e87dcacf9dc3bbb07409f42e9a9a9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.19-beta.3953.tgz","fileCount":40,"integrity":"sha512-9blmSXsUkw1BhnTrmppzREaY6MC1FNMoq6TqpeZRVn0ie8KmuHTILBu2zd463k5jMtGzzm2XIt1Liru6COlK5Q==","signatures":[{"sig":"MEQCIBw9GeGMu1ilwWrHbvTz1IqhaL8aGRKwoMukReYgidnPAiBnBQwSFqctaScFOkxxBj7cHiiAPYzv3ViuEtNW93UCRw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM/TKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDdQ/5ASTk8KR6z5mqn/Cg77wZobHedjSNPYbvhtCKEz3WTmzyu+cO\r\nX88ehFqTP9ysmeS8z1xmOhMhsmzOpQ4zxHPTgEow1NhpTy9e7XhtNRbZTtm+\r\nNK0mc/c5bV7Wys4aRWewQo1A/9xfZU3FgikZ4O6TXw5wHXF/EGleNbN+ePda\r\n74odGmNxVTBpfIIZKcZqN/Z0llEJNY/ge6AuGNAvG1csQRr6f2SNPGPVwsiN\r\nZJu7tFkqVNgXPwDO7h7wmnT2fw+XrRSVaU7Yx60oa1A/5nncVmYXgIC73zXW\r\ncS1vdhnJ2D8SzFCAtiWwVgF3T++yTU3sezuG4QmPWnd24H/roRiNIvK+ypIN\r\nT8pFq7/t0KKMX1sILFU18kejwfFRSUvMkAvZKK5P1kfHYUbUAo8Bj1NivHRc\r\nfD8e7XXBzrgRJ8UnJUhvaJa9OFiWaqu4RwEivtEBg7ndiR+kCuu3MCwJGPlV\r\nPA9ALFX6uLfJpyEQof4d32nmEA5mzIk1PiKhYWPWwvZvnQfFYr/wO2eZsr80\r\n1dC0HmIkfZD130RHBhkOJ9Y6H0Pjb0fiD3A4eDTFgL8E4AbE6Ffrlab7Jl+t\r\nP5Dg3FmT4JH63OHa9tuPNTvwrxrbtsJNZ4aS19fjEhXaFHNZVOL8hwgdDyNg\r\ntULPDysIG+3OvXZvS12VJDaRUoa5EDu0QOw=\r\n=4+3p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"b36081fbb08175c6f2a88f5e076fbef69779c1f2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3953"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.19-beta.3953_1647572170615_0.2403865565346266","host":"s3://npm-registry-packages"}},"0.14.19-beta.3964":{"name":"piral-pwa","version":"0.14.19-beta.3964","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.19-beta.3964","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1947c95c6613747858e7956c8051b2fa33d06b92","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.19-beta.3964.tgz","fileCount":40,"integrity":"sha512-UadjAcr8xWqhITQsesaC/DUtJ6JZxlyOb5GdmxR4LI/p492ztT/TXlYHd/PuPBBLGkQ4Pl7BvHSMBvpl6mglSg==","signatures":[{"sig":"MEQCIDEBpJDYfVzwf7vRBbQi7/qb9ILZBgbRdehlyBYHBVedAiAd+EupTg+Ler4I9yUbT/zlhL8h7H8wrQjZA2wgsapFDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNMzGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUuA/9Fc1YKzmCrTSvJMvejp/n51vJyBCcAbBbtf1F4CzzSf+GZZqd\r\nmX2A8DY7wmK1c5FezNZZku4sT1G3HIz4Htm6d2bl/dkxAy63qOjA+J0n04Mu\r\nE7bGgtwN6RVn683jiS3H4ogfpj5IFDDFncgKv55gn7Zb8MiJTpe2mpSAu4R/\r\nkEVZsI63mWOrDuAxYLg1JlvrFHLJBupUPqGPqZ+CbHPt0Y5fvkubu3fStdyf\r\nxZ4BOH+MCHc2KReTy4VxrKN9brt2C0v7ENtpUtLvC+llC1tkdZsIaSH9BS89\r\n8UkzO2IvwrpvcqPFyTQT6fzzvo2u1LX/3dbIIi0Icq6s6xuPkri85LRSv9aL\r\nGgTAPgJY4a2rn4D3s/ui5GMurRIQ7q0fYAdKdBcaxVNjNsWqN1uUMsfNry3I\r\nceeewXIkTiUwUb2QNkUPhVW2auAUK8k0zksgr27LBvC4cre7E0H9Mld1UBTy\r\nHh9LWCYNVZZqklsbZh9qOZyjcWa3LO/xyOf3tVk16uEqizVp+pK6fu1pdxhN\r\nI4/dCKy1Wcs0XDp3y+IV31t0dFIcRH8PVB0wIP/Ox9ivwdwtPYMbB2SD7ScS\r\nEutydWveSYAcf0lLM5EB10Dw2eysby7o9VnnJZxBWnGw8DDO1N1KQpVr5cy9\r\nhT0Izg07BIYHrCYjPL/kiYunHv9xTQcAlvU=\r\n=xPAN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"64e72e3a638df49105fe8fce5f89547657cb015a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3964"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.19-beta.3964_1647627462680_0.288788708019573","host":"s3://npm-registry-packages"}},"0.14.19-beta.3968":{"name":"piral-pwa","version":"0.14.19-beta.3968","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.19-beta.3968","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9d59965f20816bddc9bf58404233d137998c37ee","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.19-beta.3968.tgz","fileCount":40,"integrity":"sha512-HvkDMIRIUia7mUaa5lghKcIxxddnAVgTC43elA+oAfBQf/lnw/DZbKBHaGV8Kd61RJO3rtHqpv4nwe6Ko8dLSw==","signatures":[{"sig":"MEQCIC/K2/7RDCvQdmOlXW4AwNTfzlXIsut3MAyKNh0EwNcNAiAFypdDAIYRoKkAoQ7PtsD2hOdqH2wsWKxg+uNR2WrmTA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNe5FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmplpw/+OUl0lNCBniPC70eYORKWQqCcHNFuIeMdEX0Wjl9ShIiOdTVX\r\nV6C18T5/0FrsA586Y8VxgrnFjkpELdBJwI6k+x0t21EtomfwDIcA4eIpKr4g\r\nfL6dKdrwum8WNLYzjF9JmZTsFau8LrOnCZ942IwXIdXQVaOAwzGGt7LKo1E/\r\niTwq1Ut6IbkSaDMP7ILxGm4NeOoDHUNveS6g2fowcUXVDMfJpfKH16UdNEs7\r\nM+86ZDpJ3+3Adzfto6va+3byxzAJALgoiDR5ACh851Mt4zmlV/PJPSSuEBqm\r\nWekFl1YG4vfhMIFDk3oYciu4Kxzm/jLg5DXKO9+y5/4SkV7tOsw4bBFi+ZnN\r\nbyBGCr23iHVD3MPL4wZHh2srPhjdev8xTi7ZQoMoHMITkLnyvUeH0PdI4OlN\r\nnWkaYr0l97k7cJ864/LsH4ysy1N++VJKe49vUWfCDktUahL/4SynT62zPJcF\r\ndh/LE9vVoaVlUj7dndch98ypjUWfxJ4PouB2V1BKaPqxdL+pvQVCpVV8pp3h\r\n0iq84ARR3yE5lGKirjdG7UI+9n0KiPLqAr1HgVIuj5/eBgzuNmyr3LStlRX2\r\nCkkdCEcCOVaMKqqOqEXfakASVzlYXtYxZx8WdBkAu5N9GRAh6f5OoW2KCDkk\r\n1P4S8/ysT7o7l22L9XZzhxXoZNn9YCaa850=\r\n=8mw7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3065473b4bbbb26675c8973e5a53669a458ca796","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3968"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.19-beta.3968_1647701573262_0.7438584250932889","host":"s3://npm-registry-packages"}},"0.14.19-beta.3970":{"name":"piral-pwa","version":"0.14.19-beta.3970","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.19-beta.3970","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9cc39b8bc3291df82c16fdd4b40879aee43dfb74","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.19-beta.3970.tgz","fileCount":40,"integrity":"sha512-spfbKF91hOWBq73rMBXTVjoLmVrSVBPwt9x6msvns+tGldxFW+E6QXh/sYm9s/i2Gu7CHsEnzitGhQQMBROVJQ==","signatures":[{"sig":"MEQCIBwuiH5jfG4sic2FPm1dyCzN9VqJ196RiTj3DAt7lr7rAiBQ1RC9s612+rE9mUxRkoNH6CuQjSkF/xFMV22rcIn4jw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNpuQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3cQ/+IXHQHx6B2/CikIhHrXR/u22eY7SLZM7LQWuBLZjX83erHIzl\r\ntM5Bto+IwyY8E1twA3ZNcaRjKwsL+Zooi9NhdJB4giUiyAuDOgS/gmRlR+9y\r\nAdX9dMfVnf3xsIHm9o0urzcI7ALkrhzMMwegl/m48ZHplt+Gj+76mu23nsob\r\n/lpH9wXdDQ4fT1Mm5SL8XrjyuS06YHcAGwOcJXwqlBareT1c2NjFnK1ZVqFX\r\nPwYzu7wFHcoff7+icX82bhEeN0+cETQIPNEC1i6hXIyucDdu3q9j25xMjz9E\r\nH3ew6DswO8QXq4yXZUnNTMLdNp4qbR0Q1JZwTQNvHSinmkv8zCLHada4mu2S\r\nxrMicNBbSnKocY3M9joRbqwxYZ2Huf4bAsc3FMxzcQ6pTeewn5UIaRcEEjyZ\r\nmqov7q+nlKW/td7st5ZifIffjzK+LP5TRN9yMYPgfgIwtCkFvDo95wRoX/Ue\r\nFKv6ukk2S2vDyw/GZPk1gI1umXEwnhYUUgsg7QroKadVGV9ztBFIEPThibl2\r\nE72MuQqJ4qCm2KFl5OQkeiEtJO1ln5Q+u99EDTlE+0UZXzFQ//PpY9YWIYRO\r\nzk+VXiJfi1dgYlJ/5m2NK2ZuPq6RlrpYNwxpClqFwgH5Y8Lx+FCemjSVUdqq\r\ndY5IneePA4ecv/SbO4IRAGUHGlD0nD8/5Os=\r\n=6zn2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"8b31fbf437de7f335b748aeed3e0b06b78ea37b9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.19-beta.3970"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.19-beta.3970_1647745936660_0.8708584671336377","host":"s3://npm-registry-packages"}},"0.14.19":{"name":"piral-pwa","version":"0.14.19","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.19","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7c27e1b6d4c11e2de3a9b43e383c2b76d82eaf5f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.19.tgz","fileCount":40,"integrity":"sha512-2nbR1QzkCEP7VQhKSba/Z/hlqBXAa6mCJbkC0dez7ut8ZXpI8apRmCY2QX9bWs/C3arUDC02Qk8PeGYDboTEZw==","signatures":[{"sig":"MEYCIQDvFIUYYLj/8WoE+bjm7GFkHFVPGoKSztxwA/9rur9XAAIhAMu5sgOB88qYBYY8rsnctleDy5f0KtKPRsZ6qxtelh3/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNvoLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXAQ/8DNOAPm8CxMIpsSBBgYTM7U/Yx24OoOXvHV99lrrdC3vtcKw4\r\nrUxYl1/kYo8YbUA4M27GMOt3TE6NjbrlgTgEScsDvC6a++rvI0Maj3vc/ljQ\r\n6VZhNZXM6ABcjEWjTh4w0i9f0tQpyfTH8i+zg0TWP8Fp4G8nyHSJ0uY9Ct4t\r\nAtFOSkNUtiTnUDlTmVPlyAim8XnNUz1Brhs0+86dAmAhuamD/a+HNfrsU09O\r\ncSOEklefMiaZmjzZ9UOFB8qj/C3W9WsftAIq7dzhSZV9OVfFpkfHaJxIFpDn\r\nnzjxi7DSc67o2q9ttwXoGuKQbmOGjh7k4KWyQnlWlkIvFL9F19C8R8CBERUi\r\nm5A9wY7W5HLFaObfuZDbcXFeT2CTt8JXG4cnZEbCv2JLQWpQLZrHkgbxYSME\r\n6kmwFTxjVQ6D9/+hcp/0CQeHhegmLGKpp2OYGwtNFKMEM3XE0Ql5FVNbG5gA\r\nvlkbHx5kxtQ+wF6mxecA8wynVY5aXzhlndQ0uftyxh14kS0p4UegBlXRj56q\r\n13AO8P2jxqk8uILp/IdDzNKe51jr9eD2QV+gGt5QwIb/oykU5Odcu3PfaFhC\r\nYPBkgRpRKhmbKK8wfQi5IgaoNaQ7X1uinEzBARIafvingEoLiWBkDH3qvSWy\r\nSwUcLwWrbhuOboDURMnJ+6LO5w8gU7VLq+Q=\r\n=QNJV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"71ca4a75ba4138eb5f4176e45882802f338ce3e6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.19"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.19_1647770123794_0.7185846676062815","host":"s3://npm-registry-packages"}},"0.15.0-alpha.3975":{"name":"piral-pwa","version":"0.15.0-alpha.3975","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.3975","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0c4907a4932e77f7cd8c17765550edb9e1d16981","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.3975.tgz","fileCount":40,"integrity":"sha512-J1PDpZ0sYAEQVjDHO4dpf6wseTEDIq1CEBp6FyHCgwZra+bZi61sWOo3GSKeJeFUdK8JFfzouEFhjs83JmN82w==","signatures":[{"sig":"MEQCIHlJx445EStMrbh1hrGlgnRj5+/NHJhE6HUdIVN6l6/rAiA4Ppw8LNauJV0WhuqA1u1K4tHWP2z7sNkkB46lsdwWCw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOCldACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmptbg//T2jVDVPvc8Bz1KA+QN75LsRODZN2Qj/1ATrMbatBuNcu8eC1\r\n2sY6s3sEUvg/frL5K5pBSCFywWJJdkQZZh0MUIreFb4NrCA0I+TPrDTiAUbl\r\nbZhLOjQ8woLFL2gF3dErmM6nU7roOuUILg6zsUGZX+hoTYYLuO6+cG9jh6gF\r\nYSMdnHM1QfTJGykHuNmGYFv9IedEG7qgCPqXUMGMpUIjX3wGcbwUxJqp/8ov\r\n26qWQYJZgJWEesAqdqhUnXJJHGkS4xrwnCIOY+OGaK0CE4UVDIhk1cnEvWH+\r\nRWizvqHZeicXHR+Tlyjkzl3Ni6iwVXl3HPHTajlq3yxrslewwDrnxS2I6Og7\r\ne0eEixxUkZtaQT2nry8cSqfbgjyWObqvdGsnFxSKR55Z57FOIbCtD7Okm2TO\r\n0PzWQULsjmrLK+SWLSuZ3y3WSAa44V8lRLGoP2UY06EWEicxGRrPpjnofrqL\r\nJc6e/OMxn2NItE28i6zx/ZpfCbO7AhTGnh/EqP3y1EbkfE+VB+D1NPkcCjFo\r\nGAxmEqTINcT7SERTPs7urB8ej+TTOCjcmbyjh2rewROFnAbT6QrjVTa03Daj\r\nhG5KT5tD1+a0ivwQbrh2CJweBhgowEOY/t59uoAsUdRdZbiNGS2tgdX8NAuq\r\nEpLjWdRWrqJTPZW+jIBKBlQlc8Bp5PJcb5k=\r\n=2QQP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"461d63cd1957359472018b32a56778da716d3406","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.3975"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.3975_1647847773670_0.06114602014286463","host":"s3://npm-registry-packages"}},"0.14.20-beta.3989":{"name":"piral-pwa","version":"0.14.20-beta.3989","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.20-beta.3989","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2094aa022715996ee50c76c3ca0d938da1703416","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.20-beta.3989.tgz","fileCount":40,"integrity":"sha512-JoB2TiRuODJnGqpB4XvlM/FMQsK0oPZQv7/1MXPzdNLMzaaZm9EiL4wf5C4vhm0A4zJV7tla142gUh/e8nUgUw==","signatures":[{"sig":"MEQCIDjxSBIMyljOrCFcJ6zyb2JidOc3jcw+42aafIxWVDNpAiBJWEKio1dHfFkcN0w32nwcjqC160Evfq+WHKdIiIsQWQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiO+uiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolrRAAn6rOox9bkxhxUyR1l9xqxzOT9CSTuiFVrL/QPc3I7BF6daZ6\r\n0qr/IJZou96spyTlI4GCMC9UrGtm8w2LyghhcKZTHR5GnuRRZsStnk45ki39\r\n9IAFq+o6RQAjctY/SMJn+hcM134Xa8Jgy4hdHgrmGd4NXmuF2vXqCa/8qrf2\r\n+0piCCY3fIMORFdhsuCs5t5wLMDAQisAQd6nhHH9USEo1JsM4rnjVvEeOS9D\r\n2H3uZoSugAnhjxhFq+1u4FclgXxYW5M8rjpGzX+xTGnxWEQOu7dojuQq8KzT\r\nW5X+mOwFKSz5MHbdFijoZ1tYp0xPxw9CNs1f8anyskD+DtrDaETAqYlG8Yi8\r\nbkRedyggvRvb6dMzQxhWBOS14vIZPlTXAIDMt+xIYZZIfmM7VFa7ZgjT8VoW\r\nTT4t+zFcVKvGWD4+dKG4Ryt0LVUOdbw5LrwLUO7FJm71fpxH3uJMiI1ynYPw\r\nG/Wgyf2ah1RnHy6Km2NCgL0nj9x08LWIqrguZbIHoP8O2EoR5O5qCQrlkrJB\r\n7dYWhXEaC0cVOCdUAOIcI18gdRN2x71+YB9UrNlPQuqDm+aK5M6tAOF5Juh6\r\nZncRUh6fxQRvwWhU11QgUmh9/pwut2pYBj3pAzZ85+7IBr/tCgt9mmf2CoJ0\r\n6NKEmHQmMI1D3cVx6k1Yh2t+W4lUJDmfqSI=\r\n=qQtx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"50391554f3524d4490f9689a7efcb027725adc9e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.3989"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.20-beta.3989_1648094114641_0.6330268224301923","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4005":{"name":"piral-pwa","version":"0.15.0-alpha.4005","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4005","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"29f17222c854109d2f2306150ea3489fee496826","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4005.tgz","fileCount":40,"integrity":"sha512-J0acWnEkmlgR4G7qP5+2T07fOKMldf9boIux9pwTZdpoIsBdFBeSRlURGzGbqSR/MY5ec56TuJBd9j68AXL0zg==","signatures":[{"sig":"MEUCIQCpNC+G3s9ZS/zUfsukdesRtXRbutllwdR50eKnsDhrfQIgRfSsUYpuNkWAstQJycyUChPU6lnTYxz6MomRUw5xqtY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPhaRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEHA/+LDRaw4YTavru0LFsyauqmoKCf4Xe8OB6BB/QJa8IQXfTG10c\r\nU5sCGZSpfDGAOLXbuL3kp79268Zi7MohUBeh1KtqXtjEv1l2ssczIkPKB4Gt\r\niLKOiYnfY0r1Bhk5twb5lSEcwV8NU4+tjYnkuWRoUtcKVxvC2DfcV99E3tvj\r\nlc77NrDjxDCseJKTKruvwfRyoqwAczWnbc2i3Zc1VETlf2nzbBekMfXDoJlS\r\nddBsT1Z82N0N/46hUXBTITAWjHBJJQZMUHrlt2Bha2JKxjIri0Th1ch/DQk0\r\nsxj4pgeK/CIbnCDiPut9fIcaJM4m9BVHOwt89KYMOfZqu4eqZYIJf+Y+S5yh\r\nrgKarRtbJeB1Tnepo3SwA9BZAY/0hbQpp5iJLM7Rb1+FL3gAww/2YlqLTzGJ\r\nbbJteSjrn7NoOoBBZIFAid5EsaKGzBQMlNuzr8T5eFii+UPQd9nv88YMN9ct\r\nbpzd9oZVlARoUMibIkWeoJbJ6r5SmLw1VnprB40NJK0ZufS/N2B3RgJyRzCu\r\nWpGnK/KP/yUaMuXpSPIa0ZuWAa+AmUmF5VkUMazh+aAHkSAWqUJoXTmVay02\r\n2T8n6IY0/AqeY0VvydZiXbwFXvjaXTPWITEpVQQT+5ovMOAXufffZ02QvGQz\r\nyHKjyd9PGvnQhPeTFUyWOl0gNotqSB0KZfc=\r\n=0G63\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"612f2072dea6b5d02e3672be3972e850ae95d446","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4005"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4005_1648236177510_0.767144683242317","host":"s3://npm-registry-packages"}},"0.14.20-beta.4013":{"name":"piral-pwa","version":"0.14.20-beta.4013","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.20-beta.4013","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3c69bf14bb8d8a7f6d89e972542aa6cb121dfd1c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.20-beta.4013.tgz","fileCount":40,"integrity":"sha512-cuAIWgCV8yN6EYHJOqqBdRpJQKKpdn/LnLn3jaWVFkqJzR/I0Rro1hktVJu5KnTNTyUazJbBzAwc9H2cgw/tOQ==","signatures":[{"sig":"MEUCIQCU7rL2Mw6qqu5p5WfY0d8bshG1yM3ZQZuryxgf+/Z8+AIgDr7FbQ/X2ps6Ycx7LJRGmuB0WRqksvnQRPcJoau3Vdk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRMdPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrjpg/9GIlzD/jhkelxlDQ7Ndr9p86QYwlNlj8PiU78zTvMEFOtCaz4\r\nar6E8ZISg5rIplptV1a5BpjOTt/j/aM3aj0PryHOmM1we3u6KNw+GWKoakaL\r\nhS5od+TjXdoubCJ90NjneCIn2y+PzImPLTalF/C+lOaTFThw7lufM7lDjFmg\r\n7+7VGVKKjgoHtNte4EuEvmb0IPlXtYThoIkHFyKbHmpxlTcQKK0kI6AgRuAC\r\nljS90YJfA4QvLh8mipyDEYwcN0eJtpNoL3+ImhLmw0Mbmiyy/wsxWkqTC9pd\r\nlzoG4aUXt3BUefkYcriqBWMlv8SypQcWzg9BbTwEOleQrYVf9bWtfJVLP2Kb\r\nphQpn2NO0FCCI756bv+LHM5W6AwLdlgYmoWRl/zqwJ3k7g1xUysbNgrJ4GfH\r\ntrLQ+s0fcJ0gPuQiklft5MotmMJt7tEfAtPRVy+pEvAlWHEKtcDSapm0Bfxq\r\nxzkZA5Lao6tCl6ptm5bUREFBc1bgf2DwRGB6fRz+eEA0SYvZDh6PBwU3nTYf\r\nS7s6oC6RIOTKbHqsxKqKQh+azAqxi6hYZcDZTNJ7DvEGZ4XV6qlI7a7dlQtf\r\n3fsjAz449+0UDf39bjEqZuEqmToyzffK3ZHwo15nOVHsDAWqZOuLqQNt09Iu\r\nUeq2iObDi9eC0FndugX+DpDnpMWrje7upVc=\r\n=ClA8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"a3fbe2ef8cfba60b090224c262b79d5af5bb321f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.4013"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.20-beta.4013_1648674639400_0.6082878559282869","host":"s3://npm-registry-packages"}},"0.14.20-beta.4017":{"name":"piral-pwa","version":"0.14.20-beta.4017","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.20-beta.4017","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ecb360ab680aefbcb2e27b6afad112f6ec664b72","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.20-beta.4017.tgz","fileCount":40,"integrity":"sha512-rnUVq3sosAJu9+BqUwfrMo0MB5/Qn8cP076UbBZt1chE43i5VOcq9ZTMNtCUutsaZqT4LxmoB1Y9vlQ3oz/SZw==","signatures":[{"sig":"MEYCIQCAqYR0/7AanTpCx4yjDgyvMVy13i6HU6seqZgiSzRq1gIhANKrtHeOSjnVogQORzX19U1zR0lpO+ppDQRFlEvwXtZx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRVhUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrlQBAAlAhaI1yZpt74UMwWWuthyZRY/iPSkadcNfKXoQ9V8WsYuwiQ\r\n1+GNuUEjSwuz6LHmY/os1dIAEEjByRWVEz9YCjTLZaJyTRiakGWvdZV815gU\r\nDaeuqfo4JSte3ogmpYCMZxorxYLf49wEe3Ra0Ru90wSLc/aigk4+L3YWvuoG\r\nEr/EMHOi6Xkn3LaNQh3Qr4svOF9Gc8h/bw2w7/cdup2fypi0jjT0gTdodxKN\r\n+aHYk4JLHlVONJYMU4dQnVQcns+yZNdiUsP0zn9NJEdBkEPYigDps3yelX3+\r\nfJayRqWmWqk8sqOY56YjoDcs0Ba+vAbUzBSVxSDntFKYep376iKv09bvQIwt\r\n9qvgIg5Kaw2W7dOL0YdPJijOt5x3wccLb9wsPyZdMudi3chSwiw1hTMoYSSY\r\nqb0mj+2sOEIZ/p57HmWwvapo7QHbs9FPYWy/jd7M0he8SrxE5eZZeeRx/9q6\r\n9222vhnY7LxQzdZCBy68IYzMFH5ZHVXJQ2Kbw9JiUtjtDleOHl/lAFX1RqR6\r\nTJ1wt/7S4DvLxa10P2YHjlObDC0MGGs+LIB/K9cWudaj4hN/TrezXrK9h+Da\r\nlULQVm0FA88T37/5QfokKPTHnA0xv+5mtUHeyq8fq/HijSecSqAXEizqy1Xy\r\nVmKw/Xuu1bd5yyYAYDxfMcd37OicU8GeUJc=\r\n=XW8O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"cc5c00f21b8ed4e09a8bb65b8aed04f0deeffb9c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.4017"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.20-beta.4017_1648711764456_0.6533235692987345","host":"s3://npm-registry-packages"}},"0.14.20":{"name":"piral-pwa","version":"0.14.20","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.20","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d8d5816667ec2358a389770532888fc0f8339f32","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.20.tgz","fileCount":40,"integrity":"sha512-hGH5AER0zOXfLdbgbj8+Zq+/m7r7bObe94lc2wi/16DxmTJMaCW3Em+vYP0LIfQgEe+cE4FDEMCtfxihn4D2Qg==","signatures":[{"sig":"MEUCIB8jVTqBQ6vd0yjTFRVfuoGPAUOLM0f7XEjkLiLR4tBmAiEA7osmcfA8T0afWqdMUQJJ7nErQzLChMr8zfaHSPwpJCQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRrdtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpD9RAAhUWUOtVBoPT6hK8kBWW+fhlmm72Lvb8yH+LucqTdp3N3vAyY\r\nPnsMxNnE5K07Q6KVvaBPAxZSICskEC2P6PxSdyAikYLUrJa+H6CAbhJ7/WbW\r\nNvBhHd/FkTDFMyf0RxNbKCGXAmwp3eMnUJVmpandq+pcTboJebCBvJaLn4N1\r\nueekQiqg2kproVOiS2JbVfriQiAyf2tV2nDzoYmRQ+TTzyoz0/9PWxZ7SCFC\r\naLMidkvrkBj3J34mD+mI2bPNj9klXyIMXgofKEYtj8F9EwHQzFRl+TKOqhGA\r\n8cAdXJIZmEohulbOPQHj8iVHAwlthEZvJIy2N7GG6Xdze+IvNMit+poD6mkk\r\nHDqg/ePYyZLw+uBqvHqX06wIBqLNeUSWgUHzJhFPz9jPJIbp06m5DMzcY+RZ\r\nLsXR2TAYNIx9rivg4s+mo3xaBacGuekqvQslSA+5NjVSQhIanL/glAEtV+Vu\r\nTX1nFBoTOwW0bcHgLOyDm9ZJtjsWr6XrHj39DHv4J5St8IisxuD4Jss18ODw\r\n1PFxpXqg5k18qj2VFk5fUQdiu3vSmdhO2lbTWkL0gVMnhncAB1eWajtXFM7Q\r\nkQ6kUPiT7QMrLXg//hxoKzvBrpscQ3sU5mRM7T0ENzjL3F8XaLbPMgMz/2fu\r\nu1hFz+R22xS9gcCtoBKNiFMPyCbFmZJ38AY=\r\n=CXY8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"9a7775dbe470e2b10d31d40cfa9f286309b43ff9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.20"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.20_1648801645725_0.05988270589169242","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4027":{"name":"piral-pwa","version":"0.15.0-alpha.4027","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4027","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"57959e130efad649b1ba2382c423893ad3b0d4b7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4027.tgz","fileCount":40,"integrity":"sha512-sNCf8HKc1zK85vnXqQgeelEoLmfzoYFOl3Nt47DdjgETCTaM7cJNl7XR2TtcWl27xUbe0ZyHAlmCquZLGqYlUg==","signatures":[{"sig":"MEUCIQCsD+OeZf8QEbn2Z+tUcqw+0ObT5rt4JUMnbMoH4SYbGAIgafVUcL9J4clGmrZwVdkq57lNNidLPc7i0qKmLD2NzHk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiSGnYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNGg/6Arh4zTZqmcRWKSHhEzL1zrUQqIseuy9jRslz7r1AnmphJGUJ\r\ncLWCnear3WOIqT2vWw0h6DFcShdbzBaTn2qmgj8eXkQGPvCq17TJYATrHp8m\r\nBEdbUR5lhzadAwKJXvnUk0X607bR9o7qebY/IjXNyTKp5fLmeSHsjUR2zFdA\r\nOAVBoBOQUT4inDGRfDxHD/M9fxMD8bXbSTYOuWVv53n/bFRtkTnDjexDqNmI\r\nb6hjOTJW5Y1FdcWDXAoVmdjrrN3it3huqOotutFlG2LIQY9/EOhuE1N2iUBs\r\nmP1rJ/fxji68eM+Wu3FnhnuHFabMAwyG7uw0Q7UiyxJBDoOz5AatLOoUmgVq\r\ngPsiZvJ6XheaPbn0MDBRBqPPpNULFud9NhH46fp9II0W+01ABI1DeVTMRmzh\r\nnkI8hy13bUxNwk77CCru+9fJl+9aXliaXEmuZAW/KWj/aj1XlKG85EOo480D\r\nwBpMIg2ZZ0z041pxEDz+93xzc5im3ro/FnHKjaxcBhbQ0shipe0ENvpOURFV\r\nRpFVnJ1PSd0qpZ72y6P9BfwWthKEP62JELdXf7dVCJ0b42orCzTzsU4Z+8xw\r\nmSqeeoG481MJgM/0zTjO3nLjMvi4+1HpI4Pdf4YvlwKobpxK/lmoO6a+3Dxs\r\nHaPrfd/yPqkpwsmnyVPS7LnduH4LN47ho34=\r\n=lc6F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"324ff88850415188d0015efc509346705224a4dc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4027"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4027_1648912855741_0.4704675523063615","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4028":{"name":"piral-pwa","version":"0.15.0-alpha.4028","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4028","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"39112db7ec7a575aab976755dc178a008b4e795e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4028.tgz","fileCount":40,"integrity":"sha512-Uo8ECukjldOD1xO+kRJ+IaC/EMoIwQwLYLeEZjLYSkSvuNRi2Mb9GtFGApBcZp4ofvVIM2Yjf9sfZwDtMdkpXw==","signatures":[{"sig":"MEUCIQDQ8ACHvKvUkR6Bvmmu+zCHubfle8GGUxsZuy13oWvsbQIgb35xBjdXImfP7gDQyr0s3sQhOfd6Wa1xW5IebX25Ulg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiSXgbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeFg//T/3N1JKJn4VINTs9zhTo1lxZPm8jXRMAbBWaSukHuvbtv28v\r\nA05Qt1x6HBvOlJ0ryXwXUonsJmdSTHO3deSRXpr6mYKedcwn1IZfsxxbp2wN\r\nGkw98kSRHNr3XhfAhzciRuZIOavBzHTQMq6XwRbVc0rdW5ZRB6LU0tC3wEmi\r\n6x8+aTlMTo4+Wmek5JpoY80yx9CpWcbItcP3a4vsdVaHQhE9C9+wH3HfZ/BZ\r\nSKmKwY1AJvjv2Oh6+qX7gjcgiPUhffiXjfgAy0QPoPoURLZfPHNedDO0SmwO\r\nzjg043L0Z605qUmKR54vNapGYhLpj7eW8MW17wrTF6XH+H19V2LupTJz/uGD\r\njISxwm3zJ8u9whg0baG0g/mvn5EUxuVaHFRNsnH8FG3NetDnHbpSVhHH7koi\r\nUPi0dOSGhJNQKw3P48zYIC1ZiRy78BIxN7MvuqSwh8CMKSP5eiWSNhQYkb0Q\r\nlIYDZvJWR2dck1qJjyZx3CdzlKGh78iekZOGCKE2W2rU28UMTwXJyKJwGMin\r\nva9NcBEucChDxLSc8NmuhEQqB4mU2ExlPgr9ocd3uk4GRKuDeVblL9dsfMa4\r\nKuA0CVshNxFu6ydEYbUc8HHVkuPUo20+mYwnkWvURsAyKB9gNtPEXAEMlrw3\r\nhcLdKiwuFph+My+ejoPEl9yWwoep/wCrAEg=\r\n=rAQC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"1ba5128a17c1ed2276cf6eccaf53f59339888336","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4028"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4028_1648982043757_0.8984813006500612","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4029":{"name":"piral-pwa","version":"0.15.0-alpha.4029","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4029","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e549d4a22e592a691e2caf8a41688f94d2115eee","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4029.tgz","fileCount":40,"integrity":"sha512-xo93PsThToIDgICeucroWMbQaFo2J1/SG5+cUQn+XC4IddT93lCTCDawxEYYNS3FXv/yEluoSQrmwfnBXRw6Uw==","signatures":[{"sig":"MEUCIQDPs9faBjKDViFBVQ6HT7beXKwae12u7+/3TnBvtKSOpAIgflSoCeclnR/7QGYocasLJkuUS8uGOMVKE8jph8yHbCI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiSkCnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr82g//UibOkI9pyddyFyy0XlR2Wun9osLWsbbtHSbDXQQiYgCnU8tD\r\nJWrzzFU+rHDy8m031q89iTlxl4xHQhF9ZRgGkSB+t84zYcTXT0kBp+x8RcUA\r\nA3wHbG+87eOyhyQmifJUQIWs/tYhF9+T7UXwOmch00YI6gCUpkJKw/V9c1e1\r\nHyqV8fqsEC544hQHDtKuWWSv1BcB1fQEq82xAJ616NOPF2a1zvK2T9JNmjU6\r\nQU/oa8NGlwASnTITNe+u9prCzCQeES2OvdBsNlicgUrXuYsfWcmCaDyl/1qI\r\nCs2NTJFxKXN21B9SvOwQ7JMC+fLC9dBMJJdm5cI5zjfCqEi+NYHT+WC6DGp1\r\n2YEp/dXb6nA0toy7AHUDNxoSKBdKLY8MchPwLG1fHD1ndbKThVlnopBm4uUn\r\nIpjhgHDf/lRbeZXqLlyULNJMkqInY8jE12G4afAPKkQICHwZpq2ZmMv6AojY\r\nqdwqLSTjgLk8G1q+fyKC2IfYAAKwM0+T1w96WHXBj7RYjFSoWQuuOZwD0WHP\r\nwueyDr/hUDMH+BUnaZVL71peslIKVSkkuz8Nfsv94CtN/VG+dGi7R3wSoQvv\r\nLFVHvn801R0XJDj0dcHc6TwyzyHubN8GG+oT8TYR8Au2QIeci0lM52+ajN7F\r\niasLaysbWwmHdIE7l7V7sed2HhrY6SYFI+w=\r\n=mxuW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3015b782967998dbfd41ebb7367c9b4d7836ba7a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4029"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4029_1649033383466_0.6195981248071627","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4034":{"name":"piral-pwa","version":"0.15.0-alpha.4034","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4034","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a75835dea4ed7481067beb2804012b3220f8753e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4034.tgz","fileCount":40,"integrity":"sha512-FnGmK3mrszNj5uO0XuvEXVsk+hZ2SPuxdTMSxg34IzkvUjzn5WiJkRzJIvOKQdzjyJlFoMU2zKS/brsy/WmeKg==","signatures":[{"sig":"MEUCIBzFJAt5iEYsnPvwdKLap/f83ALUHSZDuCrd/uewsjALAiEAh50m+Vsb9lRWMF+sip3BC0I21z7iOQLRZq8KaRh8XEg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiSrPpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdUw/9Ejyj3nFPIL1cTt+c4dM0BBX4JM4n3Gy/uJHg1AHruqsBIiOW\r\nZ1LXScXV+NZlYVXKY+WeF0zcOdDwuw18pEd7sD9d15uwDSxsFfWuEjs2S1Dr\r\neWVLuOT5Fh0yYBwrwDq951tij7qppqqbUWg19ACkBF0R9nhGEC+Q5lE2pBEM\r\nKRkoLIA17enX04iaZxilYcoPORb0/6AZBcRj3+V24xPIohYcVLtZZv09cfGt\r\n68pvlIj9Y7eQfS4aLuqg73uBoXG8quSffWxZegRCKY6P7rxgLkVucnmge6zO\r\nAk6JfVXqD4CZ/QhxQvNRD6fzSGLDnCriAoxHt28MNi0k2DrnYfcYdzom/9fJ\r\nVnnwHmDnyi8OUHNE3qbu7hbwT8xtbqFz8V0Ts/cQ2nudFivD2uG34msCsPQN\r\ncBYjPJZ11mIQPl/bDmaMeYKLjQm3ob90zZjy1n4Pg/L0iaEoKPrhKx2Bqc6g\r\ndvnYj5w+1Iiv2N9aBwclu+g/wbz1Eh29kMVvBe1o7jnB+7PN6y8NsnT2/O17\r\nbJbWdC0wnwSvrWodkMHK3zjAoNErx4bIBWV7feSPGSUyiENi7lsz4JbMkBNm\r\nLD4FzvAoRbn1EOM799OdhvDxPBQv64zd6FkhBDFTqnC1WGm9gLQWGpyDLXN4\r\nBcxM6Gai8IKEYltgEvu1em5VfXHIyz0kcRA=\r\n=ivuG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"7f9158d7fd10d640ba9c092564275e4cc426dff9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4034"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4034_1649062889726_0.9904448333624629","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4036":{"name":"piral-pwa","version":"0.15.0-alpha.4036","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4036","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"51dcf45e1e9b0029fbceb4b55a839006398915be","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4036.tgz","fileCount":40,"integrity":"sha512-9iQS91p5jpUo8K+klFuv/biodoVtTb49VNg86CJxnAhPDJRBIUd1hOBAsuqkpt1Deh98S8vs2oM2dQtMC2yM2A==","signatures":[{"sig":"MEYCIQDOYsjzB82gFnPhpYqaPYtkzS9IE+UkyVXVeLfCxR3bsQIhAOYNd2ET1M4NRiKT06tpZ3GyNUEoNey3f73KiKuHPasj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTFqBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXGQ//Yhise7gcJGV7DphHdMF+rTW6TrssPJi0uFsW1did303SeMdk\r\nkMneXzzKudzCrsoJELRQso2oeCrjgdRzIn1byZtskCZTwfiOiqBkwKo+DCkz\r\nTvaPO0ZNsyOHSDKJy37wygY+F6RgEZPYcEmP0+c0r+JK4sZJHAWDfu/Zafhx\r\nF51lRWiHaoBItz1YRFDe/3eRInd6p67bAyMc3UyJkF7wZobvAKavCTGhNqNu\r\n3FGN8433qPG2ZfnhuOAgRSuehrp/BOb/7MEHArZo/9/ZL0ht3YlGz1auQ61B\r\nJlXWsUJXdSg1C6PW3HHdcW4b4plw+CvCFY8FwqmOxGF1B/HRYSbkyqY+jtEu\r\nS0une24Lwjq4vfZOEBUBTxviYg3NbV7Z9Wrd8ZcAK0DT59d/VsSUEyeAQUdw\r\nxPHJJc1LwcZGIVaWkqCt3WHsNcUNWNRULX48UKt6GOUXVwUg1R/bPV9rpu2c\r\nTvizxItOxLaeS409gvTVNX1HvxlqktiC3STXAqN9k5kthXTHBcrnWVt8RJEC\r\nIrnoeW0iUORksNZ256ZsnqlRJ/+tAelVZ0goHSg47QUEW3TJjNfNGk7rOrGz\r\nvJKZGazclBQh1cYHdcBBTjo6OmuDkcCbEQq66161n0PBanrjn0rUxGFtRXV6\r\nxWZflRWfksG+ik5WFv3HN+yRt5Uv6ibxWuc=\r\n=gBhC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5bd5efc3af82380f20e25d821a0de8a88c16a670","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4036"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4036_1649171073001_0.6944106523598454","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4041":{"name":"piral-pwa","version":"0.15.0-alpha.4041","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4041","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b09c2fea47d8a4b6fbb653117fe456a272c4d4b3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4041.tgz","fileCount":40,"integrity":"sha512-+glpvKPW9HfyyUT3MAml2VW8Tz37D2vzrYBirkSeTktzAy1eLh6o4NcrL1VinF7e0iK3tBFSGX1yqpRCucmryg==","signatures":[{"sig":"MEYCIQCzG+HaN6oU4uI/jvqAg80wPaRZCm9v7g3syF39Wg4pSwIhAMLqbNCFYPu8Ge42E2Up4VyK6vDDuR7h17mKXaaylm0F","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTuRiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGfA//cuT8+BrDvB/PEGt8prry/1Ku/b5Ypjsn3kPIv4H81ngGtAy+\r\nNqfFCt/1jvoob+HmgxD23b3mfXrBbO7q7E9XXhLOGUzv+RM9qnIsX+pQNhtj\r\nX1lH+NRWBBIanPRCNaKNXdur1F/4XfFtj8b7GlyQ8ZZKm0cB3zWokq+vXo3b\r\nhN7dh1srciFFGco+3eqYrvbaekZ8AAOwJsFHBABnSSImn1pOvY0ZNBJ3yAgX\r\nWougREDVNoWK7aA6H/ytpnhuSgjAQzxKmtSHZhyVQAaTR9CFERyl+kg3KILx\r\ndSsSs2BVpAWTNOCQqcADhuqwpS7amSO4kCl7s49la4w63rXjO0oIEgjYEOLQ\r\nifMZjcxdKyK+P18n5JGy6aESxUzOy91UYWtyIGrgK1b1AW2sgFp5+UdoiWF8\r\npPIi2O/T/6TrZNK90X24zHd1esqFW2jZa4IDb74WbRqa2fwP/yx5IRcVT3dS\r\nZnWeNu/Rmg5cYmxOHKLKGf9RJOZbGWgGYVDuCpQEnLQN3ZvneYzDsBNgbjX6\r\nYwGzZlTeeowJyXT/bkRksAtodje+bl/+jazvbxnhM6JEYjuOidfI4DpeIDpE\r\nLYSrbFgEdpqsHrKakjLDwUrcKsT1UCob8G7pUTuPbbRc8w9YnH3datlQN9/F\r\nRd/3dwqR15HSmVxFSlQD4VUoXDPPJih8mmQ=\r\n=jpZM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"3d305d88c72e3e05a44acbf240a38f6ad7b03959","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4041"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4041_1649337442037_0.03403247657967379","host":"s3://npm-registry-packages"}},"0.14.20-beta.4064":{"name":"piral-pwa","version":"0.14.20-beta.4064","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.20-beta.4064","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"eabac1c332f3febcb6e7b4d917095c49bc6877a6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.20-beta.4064.tgz","fileCount":40,"integrity":"sha512-k45YswtTWkZScL+L2VFzBkiHi0N60cv484gKzW6v3HUmT0bgyEh956IN94dMHZ6v/NpxG4XwJoUEwGCjubhDBA==","signatures":[{"sig":"MEUCIQCdfY6kWFDrUu6BnTmnxhozjSSr/y67J6rzF6uvW0k3mAIgfqvkUS4c5HuGjzNb06IupyjDuGjnUvSt5LH+C2VGOO8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUrxpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3Nw/+PJrLaC6wFDon8PV2jlaeVYAjRU0aGPnHzso3WLMybXViZWAR\r\n4vQS5ZTwxROpD6BHXOQ9jI91kdO+5jbXoiV9tkZnLxJPjE0bAMOYMpS97sv3\r\nHpJOUpA5zxBVPV29mFBobKkXsgQIvgYaqce6Sf7YOTwK5vx/3UgtkIXRdUhR\r\nUxdlGa5to/qJCUXnQt+q1B6gZAGZ2dzqlXcB3SG92iV4o2tdWtqiUA61S70G\r\nO3dXTTpPSdvPCRR8WiWV9Bg7Ziz2YL2+JQqQAsc3LX2EnpWoGtaRQY0SrWOS\r\nl23FCX1C1F28ibCQkzHWnrj0gq/NFh6DIcLvSAhxsQe2ULe5+mSw5uWG9y3r\r\n/H4qd0oXal1UpQz3OaSAO7VjxNBgVZl9o2L2jxhjEI42MbGIBePIpYCwXgQ9\r\nbYSVgQ8FtW3Bk1keXOtl2C/9vfAS6sBgRGOw+OmDKB5//KbiRvS1koMGmK27\r\n4NbMXGzZeb5E6BZQw1jYOsF9jlJaE5uap6FEAvIkq/1ys8RBBMSgj8UT/V2g\r\ns5QtDGClig2seTY9FFqw03jbadFVYBbAz8yIXCUpI+s/49ZbZzL+6sYSwge2\r\nTguklYxXSUHBf3N/vvEsLDWWCfe7K+GUfqNCgzGbZL6tLOhWta8TDBeqh35I\r\ng4Qf8oHUMFDpX7S9zx+fcTnDquTNdRAWlaE=\r\n=FKXu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"bc570a7fe7c77065c4afc481953d711e32c84858","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.4064"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.20-beta.4064_1649589353545_0.1878646850350303","host":"s3://npm-registry-packages"}},"0.14.20-beta.4067":{"name":"piral-pwa","version":"0.14.20-beta.4067","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.20-beta.4067","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f400179232c0c48305c80d598a2302df804f05b0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.20-beta.4067.tgz","fileCount":40,"integrity":"sha512-Uf/BInwq1nFVIfa1Tp6FbINdixYqFIUVutAQtxNzkKJBzI80KmpUUOM8MOOaV8K/n5by1NbRN7sGqKkN9fl2rQ==","signatures":[{"sig":"MEUCIGUbMo/pR9lfE5OGS/WUSBGFYIajVvw/hyToepajX7eCAiEA8X79Q0wBTk0Gk2YeDdvLoTYssboKTsvPFIVxsbriH40=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUu7gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmozUA/+NHntdOS1itcxld9vtbB5v7sPHzM7haFap0xpKy3wgV1UUMB/\r\nKYno5xbespN3GslslXoFVtTWXjQaBVf8XHzMDm5wvbvZGN/qvFUtmzg2u1tc\r\nOo7dTvLhKMP//JOxo2hr8psyaVVKnw+jLJqeBdz1zAb9ps86mLkBdaJnSXgE\r\nI5dffZZl7RKGmhECbUfog4ILquRdnwxYH9EY26cD/gkzO3nwHYvx8namFSkj\r\n2MS7F/qcI1PodfS2Ht74ujESGdD0NDTc6Iz5qMzR3YQqcX8kzrmIXnDU20JM\r\niPqypfZlAwwN3HIL/OtdVGtwdtEaV4XTS73/QQSJ4USRpgmNFNY74QAGdfUf\r\nN0Jbot4hRvEMO99orFoFOaO+fxYcvzzwtj3YNE8ucfrLMG7XgH1AhWLvFG7F\r\nR7i5gVkEOm83R0iH505TgujPZ8+oaZMFJJdwGMRu1T1QfIReYoTG2VKf8J5L\r\n5EHnvQgkNOWTw6FJK3g0C6DPPPjlhymRzZzatGsdY63uetj8jNtuAm3Vo1Ku\r\nvbABHxWAxPaAGFFCw2Sc2B6t0vKx93CFs1jrc8fL6ZSFWv74nFkyqQWxUhWo\r\n8QWWMTSFAntPUXkChTzRQ8XyuEZL0IAX/XFObf5BOJERaf1wHucJrlj4b6Dp\r\nAOvUQNb8V8qy4X+MlnklFecfiD2+GoFLhzA=\r\n=lDNy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"5b43da5b2d6fab54ddc757fc76e34a603e3d6b0d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.20-beta.4067"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.20-beta.4067_1649602272267_0.29840593663881565","host":"s3://npm-registry-packages"}},"0.14.21-beta.4074":{"name":"piral-pwa","version":"0.14.21-beta.4074","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.21-beta.4074","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7380f850e83ea5a433ffdac9a3628c970fff1d36","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.21-beta.4074.tgz","fileCount":40,"integrity":"sha512-4DuKn2uTFPM17YMpU57LSznYfNfmJmkWshG/l4qrhvHYT3FAHLxNxWCWH55b39dhvoBa/7ucIBkJMhk1D6mPtQ==","signatures":[{"sig":"MEQCIDjdSEfSAcX1HDtkOICfFbSNkgLYQcLXwkgdOeqB1RdxAiATC4h19PrqrL7oE9q6qIIyphVrfg1GeOJ5Fxv1wp/sZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVASGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0Mw//cboWQz1N8RU4txbtxy9eJ2dq3Gbi1jEIz7EIgpTpFCg0TnVa\r\nqP+JScHBYdZG1dI3V/OyKxlfGEh5/0RU4dLqZXe/xyQNRBlMfYZoKp1675Lk\r\n+S5t1q/MMV9wCoqCPETYZWBxwcpbeqqzAKvWeVk+iNgJwRDibjjFCTuu3zBX\r\nDodAU3+k9MsmvuPVh5V2gOSAGSLlIHZMaTnZ4Q5Fa8ble1OqQX4C18BEDqkb\r\nQXh3EtMoqL966LU+NvXtwT2gv2gMGBPnT/mxONAc2gHbLYD3RB/budY6JZe0\r\nghK8VYzz9fWJWlekcv2CWXXGvQumskASDOg+5TAwYZwBk63EggF44yPg2Qe5\r\nP5Iv2F5Ri/wx1J/pNKheC/B/cE/BjUJTNHtzrc+I9LyygGI57P7o0v9p5xMR\r\niKe8jB79rbGBaoUv6HNw7MBeHj69wrwfISIOkBtJg4jMXhRds0sFuDrW73k+\r\n+2UaHkuun6cit+FIPVjF+eaQB5HojGnR8ElSYvGqJMo6wnHJiSYr4unDAnSH\r\nLwYX7MpQIFAKzMgE1UKvovVGDcI7VtJezXweynbcx+w9eIh7LJWdb5wy5UiH\r\nlHRzkJm4k0BiensnYRvMrli/4qgnfz1UyWBTDYJxuDfHaSdUH9i6Y9Tak/Mp\r\nD/AvZn7vhZWaau0F+N78EfXrTVCjiSN9IBs=\r\n=2xKW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"dcc8d22f7d2b122da4cd1038cc57771089694c1a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.21-beta.4074"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.21-beta.4074_1649673350462_0.8373621326936052","host":"s3://npm-registry-packages"}},"0.14.21-beta.4078":{"name":"piral-pwa","version":"0.14.21-beta.4078","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.21-beta.4078","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f190b46745fa714218789c2b4de50de6aa96f018","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.21-beta.4078.tgz","fileCount":40,"integrity":"sha512-dUfTbwmNf+Dye8CRcM5JFjB7RS4P5Y348T2qSjtJCENoWJKIlqn/geI2eu87D8vor3Yv93MfGOv3gdCTwJtDxA==","signatures":[{"sig":"MEUCIQDIiuIYKXBWohGcwNpPVe4e9it3f4vw77MNQJeCRXVNeAIgDAifCIraixyu4ADVZAZHlAzylaXUiIHxrq3tvT2cluE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVGAnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUdA//Yn9DA+PXMaog/4Rey9/uaUATCNJ/Gw/4ruaXGm2ds7d+IO6k\r\nQgGkPpLjAjSeH8hxYqGbK8Vnhz2WSp/fWrC713cM/u5SC1nU7WsdkicxGuwI\r\n7szkdCiGueNWBus9MpcCJ1sdw8U2IRFm7DSReOSIQNKCRjhvdoJddPYS0WDi\r\nPf2nMc9wiE5t40wQoGt3Sa2/yKlNtXEfb3T1TeCcyFIpj3Gy8vMQw45e8rwp\r\nJ8KqQb4fXMfXRFBzMiF5qUvVanAFIbW834f18iZQakgPPpnI73KSM/QjKzY6\r\nRQFROMZGYf+h1ySqTcp+bTklRSmru/Mv6YFqxOzisJPAITWOBznLtaDDA4dE\r\n8JAiEL41BbAm0IP7CL2Qt3fFdpIdMtM68RRsEz5XtBjsdgCRbikZ5U9kKfTW\r\ncWBZqZiCpQf/wuyEbs1jWRARQqgfWWVxGRpJtCLftUz2mBfdTgYZJNwlf0P6\r\nRqoyzqYsIypsOXsfy2E2IlYgdEsR1exgqb1G5PbyB3zGclXyEF/YRol6fRYN\r\nDZII5bA6tr3OAUAL80BHFtem1Wt3IQmfN1lKdGH3IFQqs0CBtXDGB66XWV35\r\nIN99HRBn/zwoaLyCZ4bFeuj5/n3RfoSnPNRKaZSpKhPITLLsw95kbQgljF5N\r\nJCWrh73ZgK1azuidKJfvSQtiavIhFO8A04c=\r\n=F1+u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"d749c0bccec08ba46738559a398f276d4adff221","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.21-beta.4078"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.21-beta.4078_1649696807288_0.8676211223086387","host":"s3://npm-registry-packages"}},"0.14.21":{"name":"piral-pwa","version":"0.14.21","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.21","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ce5c5ab8fff83ff315341695cd0b4f3e0d9b1663","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.21.tgz","fileCount":40,"integrity":"sha512-0FgcDVFQG/9JZcSQRLkAQdwkcJ4Xyf2UIpxsrPVN5JeUL5adEGmsxK6H/HKGJ3oO3hurSGd7TIWF+BESeOgQrw==","signatures":[{"sig":"MEYCIQCSmz5V01/nbQwZsOLFUaq+w9AXTKGdM8MvicynhT+IDQIhANPQydBj71Y378ofRbiJtw2LtFvtMAt13IKihrkqHfi5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVa86ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSgA//QI1B8b65sK5SuCOppO7QAPMDYKckyQSqMlqrMblDkPXcHWNJ\r\nthhHnRcyOIL5cGMSBYx01hm2OaJvNot/R3rvfvtgQbpcjMvyyAQU7IJwoT1r\r\nvPW6ha+gmXgzNYMgcAQwdnx+efsalKU5kMK4LqN7CdxzAE6adUz8U6w6GGDl\r\n+GJCj5XTaFDSKRz41hO/3MvIdJ+b7lNkkK6FxGOSNBdSE+2ji4m7cuNjPWl1\r\ngdKLwoL0jdNuWzjmkEPMlxYyYiGLLKPWkFsmV0lIq8kIIdU3I7TlxplqTkVd\r\nEUNvwl13t6iKrXWSWBfUqjIBPMi045WlSVZ4ngQiHyLTw31GjOI/1+U9z7je\r\naV54LiCtx/FzgAJgxztI5j5IzWHkVqRKRT9p/y5pOcXdeuPg86GdEAHx8LuX\r\n5vxrMUY93PLqer371VZ9E3kpqxVOunj2IVtF+nwyIrpYnvBX9wbjQa8sWdcf\r\nODenqyUZxfYo0414rbLquyUfEFM0rXpDVrwsjJbFj47Dh5TzCpubUaGLI2OY\r\nP2uCQ2CFya//UOEyB7AU9Rl6UxXgW9qeKt1UtrrdXbkF1KtEFfMok2mK20RI\r\nVHAQ1Ws+VzSuUsADOnYpCYfixTumD/XDcFho58nB6/2gjl1n32RzFcuQkK8r\r\n7XSd06hdDsDIqgBrLtr6xUYfJGoH1P+EMHs=\r\n=uL+x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","gitHead":"28d12711859b01c425da9242f08b6a7270cc3686","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.21"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.21_1649782586051_0.623399054505005","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4098":{"name":"piral-pwa","version":"0.15.0-alpha.4098","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4098","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0ac81245d0ba42a7da0589a856c971970d066070","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4098.tgz","fileCount":40,"integrity":"sha512-UjMU/OqQ58ZoVbq9PAtV1Oi/smK8R1bwmFZdK7MY9rZbT8G9lYKKney7xTnUBSpZL/Xe0Y3fj93MEd4vmZfxRg==","signatures":[{"sig":"MEQCICE0wdt+2ytbpIzegmuRL3ii67LS11uLtN0ELGMtbrGyAiBP8VVKCMtyOWbEA0udLTGNl8Kvfi8dG7ouL28ZlvDCuA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60018,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVuqAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLDQ//dtDaSbdbOmHe6DBd6Fce08pTdj13x/5Tv4s8QIh63kBy6YDN\r\nk9GYZIZ5MaFT0h8Dt/P39e38lrxwYJS8ulowqpAXpWjLUy6MpqBVGwwli+UR\r\n2yebAHSOIXS4hssrIsNC1UefBYkdtCENtAIPwameHNhVmpFM+vVqgJL37tH3\r\nXo+ICeTvUFk2vh9MqCCucKFVXH1ZpRYGUj0D//2LaK6giTxhscFcU0I2Wqk2\r\nza7pZlBCSHEl2G4MOH985iXLHUrfiClxwfY+j8HhX6pSt3yGExpnAqHYmSdW\r\nqI/Zgjr/OFVzfunrUIxtnLYqBtIxy4QfXiHywBGmEUbKe8tpy68/mnhNwdVs\r\nVK0YUrKrm4qGY3G7lQAfuT868MQjRpi2elBNzXA8c0xeXrh5dsjR4yrrBOo8\r\nHBrlCGDeVvETuyW3mTfiE0FSI1lBgS4ksT0FziWGOYUlcxQwkpPRLff+uC1v\r\nVJsT39UNU8KtWI4XlXDIVcJ7EbRmU0IwXalY8YuJhh9pUZb5mBPWHPm55OU5\r\nZztAxatqskIJRInreOyJp14dK7mc0j5EnxTklspckpgm85RyArRwxg75c4dn\r\nL898pe/LnQ25aDA4WMDxKgqyX+xuS0tao5fOuJosCVqGP1C27U1SVjQ8/km/\r\n0HfDxHOt7CzV/NEpuXfy8bjyUZGgrY+nSZw=\r\n=kRib\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"02ef35574b29cc5dd93c515bfdf27dd523893b28","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4098"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4098_1649863295813_0.3900333666690232","host":"s3://npm-registry-packages"}},"0.14.22-beta.4103":{"name":"piral-pwa","version":"0.14.22-beta.4103","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.22-beta.4103","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1f08ebc32186c8a24f3be920320c6758123cf23a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.22-beta.4103.tgz","fileCount":40,"integrity":"sha512-MiRD9gj5XUSPqJ4mo5QETZPbZeZQiev2/kCKudcibCMwP6fsVau6irvrVTBAw4pDYWm3Gtrn2TPa6wrkbD4ffg==","signatures":[{"sig":"MEUCIGvzNClvxtwSjluYIO9tSzNQN0kpz2wJJlur8Q/LjcdnAiEA6BYhRpCHVy7WlcBrACh7d+TP9RKSv7gWsLpc6w9nnLo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXdqWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNFQ/8C7H99E1GxQbZxKefWRnfCKKIl2C3gj3Hfgt0yeKmkVifxv3A\r\no04oXqkaAuZMcjnpcG/D8krCgOjwcHlfUnGaJlp+PBYQqjBvW+Me/uyja7z9\r\nI63p/aoqDKsKXZ3jZcwMIlKDtrEt84bJPJVuftlJSxeIuz3jUZi5vYeOQncJ\r\nbjkn468gQc8vAz4uAbcAafraVPgQnb9lKTPamu2otbYlnebvixUrZxqIIDIY\r\nvtC9X+RGa/LmlFReadLlIZZkKmCyypQwO6tMTWL7HSdofeOf42f+lLNPrGxC\r\n0LJRbYCZvd+nEsKUMlKMBvDuhT8GfvgKNN7jTlNe5BhTm4K32bWXa7SkNpx7\r\nz3c2BDaPQClFLbdKHmGwYrIrLBhM80GpiRwRTTEgZ6GAY6/f/NgAmJmj+qrr\r\nt0nH0ttHfg59ra+eiwGKXo5xliwdY/uaHRkKmfvIVSkvZYsdBSoelvTIWYwY\r\naF8L7FnjsFg5yuMSLeCse89TzzbxMSMzBFclF+iZvr2laqKpY5DpAsY4f+gX\r\naBsSsbfjnAWqw0pXljDb+xeBbLwLL09WfBBLBY9CKtusgrlQgXB+RQdcXBdf\r\nLm+cZ8QkaQkdybIHstRqqr/MifI7QSjdixAql6EXcKXjksRMJcXz9lFfAnLF\r\nmcMPcH733l8dTTWvJdIBMH8HIoRM5IsBY6A=\r\n=9bcZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","gitHead":"0c44955d9c1d88a3b081bd779a2d60537ead1abc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.22-beta.4103"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.22-beta.4103_1650317973856_0.46317805036747384","host":"s3://npm-registry-packages"}},"0.14.22-beta.4113":{"name":"piral-pwa","version":"0.14.22-beta.4113","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.22-beta.4113","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3d0391dd6a8d592e02bd3622e61a4b467571657c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.22-beta.4113.tgz","fileCount":40,"integrity":"sha512-T/F0ri8z2qmSKM9kP42mC9DFE39LlIeSgchiC+ESwwOUHiKbyPe16iRS2M03Bko7N0MHEbOzG0qUbMpO3ZcW6g==","signatures":[{"sig":"MEUCIQDBA6wr1gfRtehimyPItf8RIFOS2+oCc3lxx5ZXxeImUQIgSKhzqJ2O8YoszCX8vxEHOjUTe7WTL4tzi3S4nmFxXng=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZpubACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqB+hAAlJ7iJanFDU9gzdqjSpc/xnO+ML9wqKEQu5WkLCSseLlEDY+v\r\nMHvrN9ai5bAMlOd0EhbrtZzaI9ZhvtdwywOEnKT1H24g0fPoZA62eny//Zgm\r\necyCkb9j/HhjdBHdiMjhtjj993TIYsj37Dm7HIJzpC/wAF0sWqSi2NrooTF9\r\nUftz+CBQPVTns69/5khJF667wH8dCWBQWCWiZ4Kjvhg3NmtmhYDf2ovWZlCE\r\n48YnJDymCm62Ny8drh/xJS6dZrAAnqsQmR061X4HMHMBoYemu4Tg44qjLT0d\r\nrIJiZLpDKBkhy5lcpoBZYo6VAhFf7Fy+21z+BuwrgABtsmbAfFtXgBH+o0bw\r\nY3FYLWaRmRF4GyvdrUKQWGEOuFdwPygP7/xZGyUkrXt0oeVJp1XqGsFsrVCF\r\n+95r0T2by+Ss9HbqXqE7g3/hRi7hpxn7L+qZAs24BSErorx/XU2CkC/w9gsZ\r\nfmo8QXulbO4Kn+kJnRShaIyxM5WFGrW5Jc4Aftn3zexxL9AV5lsIA+NFzOV1\r\nZHrWHzOqidkxGSAbnMezqCj179k+5ryS4ICXEAJRbHTcyiGcRenbvQ61vSS1\r\n1GAbod4+zr7unJqt7BTHOWWKbjMrqmL65EzJRf45thmnLbaVe5vglItNNyTF\r\nDq/LDTaZI/8pAmdi9TWNbCuLnX6Pt6DiRB4=\r\n=N8Ka\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./package.json":"./package.json"},"gitHead":"3997f0175dd1e48b0fb0258468d094a7f97d7f81","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.22-beta.4113"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.22-beta.4113_1650891675527_0.0216767603362642","host":"s3://npm-registry-packages"}},"0.14.22":{"name":"piral-pwa","version":"0.14.22","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.22","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"98063ce08658081bcd2f7462e3fec4e7ae04204a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.22.tgz","fileCount":40,"integrity":"sha512-Mi0eTc64F4830bT9qB93VgBfdeqA4TmEeIx4obkzgZprzN1P4k0EPv7bDio5HpQQ1wgGAmBRYxEVnNYrE6st8Q==","signatures":[{"sig":"MEUCIGez+NxzcfZ0CcnhMpgQSFLDyBuSOfnsxi1so/vyqE3HAiEA4nweTRIkAhp8uLmUD/z68sm2SINrz59fFoAb2CD0aU4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZsiZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7IhAAgdhWWMPhV1QqZh0xRrs0FjWxJy+eiRgLZJuGtC/rwYNh6rhY\r\nikCW39R5+Hq3KLs2z3I/AEuRZbnMHxjEVCtzmFz0HFRsQj3gYzUntjKBg4MO\r\nBUaGJcYlqFUl4VgU360N4WFza2/4qE7UNbQ8H6F65Y/nyX4h0BHetxgO2MEt\r\nbN2NK4x5/iyib9jiXNQ763VnclxjCZCz+4joJLtlu2wt7be54ZjEJIHhpWEK\r\n2RNSFW5IUGRbyRcu2ZPiXMAXYQso83wMlZxdYrcTx1/vnDn4IImCjIMVNX81\r\nEycHXncDqHRVzPfFvFss4VRkM8garKyoKlEPT5OS3aBqBOqxhZqsaSmgJJWf\r\n8g4n2Dy8ZJrey135AP9LT+2GnYxZKZCg1d0kv9rtBX+JuXxaEGCqulSw8hTQ\r\nS7I3DyOS77OVeEZ4SGagg9dWidKcBkFgC+G3YTFl20OW/6Hu8ZfpSjyfphv/\r\n0Mb/guAOeLHwP5QvKRrxXyH+lpe5ExLPE7SBLGjWAuUazyHUOtZtxU2veVkh\r\nPC2DWRTTkDH/tvENyGbzsIkMnkS7CVvGRBZKKSjhtn8e7wxQ87OtRIL0hO8V\r\nAMPt7bCdE7fnHmtCY2tmBGbdg8P+i4pgzMkdBsCVCmFou6744fh7M2am68yt\r\n537/Nw9om7R5wEv+malnnfPS5cV3a1tzA2k=\r\n=8FYz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./package.json":"./package.json"},"gitHead":"5b6e4ac5e478900d398c71adb6a4af9fd35bd1d7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.22"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.22_1650903192861_0.44757955891891976","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4122":{"name":"piral-pwa","version":"0.15.0-alpha.4122","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4122","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4b4a99074fdf5e085b5bc54de781a71a389cca01","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4122.tgz","fileCount":40,"integrity":"sha512-aUw/nq419f2uDPjXJ0Tcc5lkKQSzzGGVkox9cPbjALtAAU6MBLJZNXPT82joRTp3piFmDM0RoUgLq5HC2McUiw==","signatures":[{"sig":"MEYCIQD4e7v6JGlGa+OD9f6BlCT2PmZH2IzuFvY2oN0qtkj3NwIhAPQozBHDUhUyxMFZ1ze+hQoGeS8cONcbPlSLJ/PAw4yk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZ/UwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMzg/9HaNRoC+DBYL8kTyp/0p5jPRRHH3cVm7V1aKcY29jDmWnE7SC\r\nswZJ6MiY4yxJhMhi/JvHaSDBcQYhrUsFj76Aaa00/o+ujM1witMHe/+YkOuP\r\npSgiuJmTpRalcEvJU586UgYr3nYMy5D0exu/E6IKWTdbqO/iSEdy4Uh3TBzj\r\nWXLbK6Atf/P35eAZWuzLYFxVfwYKAuwGog1DUPSo4z9YkUyEQb8X85+uHySv\r\nTU/w6sQaytDAa8m+PRBOyZpx4OqdIoZinKhNqjtaK8/KRBQp7PH2p6F3t3CL\r\nTrfyBB3G/nFuaMFC8kjUOYZ0//OG0OB7XZqmop+03HZmJUaAvKrNva7PVHr8\r\nllyVVK8B1+tgU2UMPAMdyXOo6pKmcaioaKxkVhQ9GeTrEAHspWvXCE/Ed8KV\r\naGZiQ0RCNRre0hxMu9XFc5y5J4z6FGkM5y4srb0c08FinxeWqlAHOlBCWW5k\r\nyl3ajet9xFSkU9vvZcak/RL54i3x9StgyfgZe1go+5c7CvnIWvWVnXOCWQ5m\r\ngTE99Vz1elqTm5dmCAyK+msWQ0DrhSVl7QDaRDlMqzX6C6ryFPb0LeSCQo10\r\nCVnGa8jnTKQBcS2Y16gbUY4cKMH5aXYCjFW0qu923Tbe59+8SMm2KT8DOMZd\r\ngt/YMnyxpC0iG6DVgJLnono9MR1Sh7sE+8E=\r\n=gJ2b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./package.json":"./package.json"},"gitHead":"fa0957fe7dedebbbd97a530e518c1a2b7754d475","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4122"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4122_1650980144235_0.6811168241936856","host":"s3://npm-registry-packages"}},"0.14.23-beta.4124":{"name":"piral-pwa","version":"0.14.23-beta.4124","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.23-beta.4124","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"028977e212ebe79d361c2122488579ee81e68c43","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.23-beta.4124.tgz","fileCount":40,"integrity":"sha512-HFLUTkFNfG3xrjdSrJHXS7IKicshKULzf2Rp2h2hqzec2623MYlTTA7O+hYPC5brwo+dW5SnYIWgsnRKNb3PeQ==","signatures":[{"sig":"MEQCIFVhu979y+uG/UVcNPU1mfU1oN+3K7gWZqamnUGzmB7fAiBawpKdHCBq0f9IT7qID+tYqIBqL4cUZI3UqwfWZ5SHlg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaV0uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6FA/9EQvEvMvuJ4MOMVK1TdD+J9fu4hmZkhqPAQolBh1ZXDucIhMN\r\nU8KTKOgJ7dqeSG5/JgqJSPAcTC1zp6Jjy3aa7k/lFsYGzhds5wswUN5tWldq\r\nToEDiulbo5iXywek2/lRudQNvWlG3drqMdGsrqtIAaI1PAt1gIIJpM1faqqS\r\nG5dULbKUDPWzkc9LhxBuGd+vhkpf+BESVpNfnT6sCdJfvuJXgHpFK0bHEXxx\r\nHMR0juDXMt8z34u4EiT6RK1voYsE9St8gaGi9oA51i2B2+rxjSOcNdJOHs/R\r\nvRGsrkB7aJJ/DpiL3aULOHWkIBFtTaHPhHQKfeMczem5goUS9SicYTehquyq\r\nERgD/0JuaPeukMTh46snXsnWJ1l/1LCLgDeXEtbGO4etm+fX3T7ByTdXgxvw\r\nxJNckd8Q4Sv64Uqbt790pLxBKOOKkvfy272O3ngfVUH+Clsex1ROM2k/IY38\r\nAc6WxAYkTWq697cfD4GjgmG4jnO2Ay5DwS35cblN31G+lBMC2QsBwojqgihG\r\n7BuFwdsZWj1IfxPw5Ac6KPAHXeAV7jNkW9mq4Y1QRYMsQ8Z8C9XdHaQAyeuy\r\nisWlbA3Id1l+VXxrsHb/rXJ2A5WyEEmRInNIgt7z7dtboDcTcMwhMACP0Z1z\r\nCkMXuBOpm9rLcOuS89PTTmNa9Kx8PAlA2iU=\r\n=8wa/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./package.json":"./package.json"},"gitHead":"cc9d2e72edff0faffad79f84d28a114e195461a0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.23-beta.4124"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.23-beta.4124_1651072302067_0.9156881041160148","host":"s3://npm-registry-packages"}},"0.14.23-beta.4129":{"name":"piral-pwa","version":"0.14.23-beta.4129","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.23-beta.4129","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1c9aad92c316d21ac143999b112ccebb77a7bceb","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.23-beta.4129.tgz","fileCount":40,"integrity":"sha512-ps2UKXj2BiY/YnkL/gLxJ6gJiBnSK0+TK7EOZI78l3ZRGv3LvLiZQCyaXvdcDq+Pbo7UKeOYIMCaLC2UwT54Ig==","signatures":[{"sig":"MEUCIHJ9qRh7VZbAWFa9+inwt2LGGXzy9m7pAY1XMX5VKdF4AiEAgcZ9VNAEJGi9U9XkJF/Ygan/dwqRJ+iGJdKB+xYMqzo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibPT9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonSA/+Ni3iE3Vd2qGGygxqIP5w2GDTMExib4/BZneDquQrb3tCuoAp\r\nVPZ1L0X/A9paHCPt3GICgd3ihq6N9PGCjMPRsmZQ2HFUYY5rJ2TkYtPtxFSz\r\nn1gZKPh0/heNFPvnklLEwEoqYrYQrfGoVLGSTx7W+SLcXndrE10BOPI674wF\r\nleJ7+xkS8QDy/Lk8bSMwPVhJEenx8C2Tkj+J20NcImWSzH3xTYEP99qxN3Tm\r\nY3FU0rgPOLy2T0AeTde74JHd92fyalj/errIj6X3p9+khXcVQD1y64BoE8gw\r\ngkKeT5OUxnTiloDngXlqy1cWOhbiN1YBEB6qJIAEZmjT/fv1JRENz+m/P0lg\r\nM4LYoC3kJGQQA8Dt/ve9EAvH2KMQ+QYDM/Jk8EQuXHkdAde2Qs7K2Cst33J0\r\noql4Ro9sxecNZwuS3+j6GZGyWFy5o5ClzA8GLvMsUXxBLaj0F+XFLYPrFaBe\r\nSAagfkLk4H0V5LCXG8eVo1y2jZOy0aSRRgHGIMacCqqrubFnmkwEb6WDcYR4\r\njnhW0Vo6KcDso26zLKUOxSNE3FIxWjU/aF5iFBBETVk0ckaB5xBKjMC/Itgh\r\ntmAJPDs43GHTrA2n8v8BLi1nIMtlIbZ+Uoi6g+J51uuvBn0NxxiJKtwNvLyh\r\ndai2+xR5mPQmd8X8VMf4jTLAgRw7o10fOhk=\r\n=TvYV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./package.json":"./package.json"},"gitHead":"713afe482d732f86c193c8defdc493d2f5da9b57","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.23-beta.4129"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.23-beta.4129_1651307772844_0.16780525774096278","host":"s3://npm-registry-packages"}},"0.14.23-beta.4131":{"name":"piral-pwa","version":"0.14.23-beta.4131","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.23-beta.4131","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e0db7940c1eb95e68085c4ec51ea955b67bd545e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.23-beta.4131.tgz","fileCount":40,"integrity":"sha512-cwJoferY8zs5zTQNHjo6e5l5WiASn4TPr5g6yeE4iCGhEYtGZlaBHLWVZXNzjogSmlJ8fFA4lrx3CDq3n/JboA==","signatures":[{"sig":"MEQCIA9lCqLepZGD5NdDLNeVoLzH2gwP6lftDezq89fBDk24AiAKucDGee/t3w1LxxGoG7Rxw3PVNERUaDQkXgqlD7J5SQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibUnlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLQw/+MgJmYDRSfzIi0HhOWeHYyr3AJpx12OqLl7pEFh1IOc7s6NoK\r\nQNOhDDJ920oLioqI2UHSXjoTq8GFnXemE0W62eELg1Jaeua/V1yGn1sU4/1J\r\nNyI7HtimlN7YVF0gN49bo0wN44qYZ5FOpZJ3bTeCgGjZS+XkZm6dieGK2OgE\r\nVkEPsCT5ylB8Az9gwLyfaci1IKYBkSJAGHWAZshjn0v56vwPmlAWk6NvzUTR\r\nnwgz5H6WdrZFguybcFelQ1QefqMtf39Ou9p8pebs024w+OplVqJM/o3Lh3IJ\r\n9xIUFhiVqnvRSqqbYJui1V4U+p7uTUFlWuvvGPU2EHaGw2sRrQLwyBjgWCrG\r\nP0aYBJN+J/AdAOkol11Q/ZB7BXYMkP5UVwh+5RDrBAxf3bMW/GyEMVEOK2Ts\r\n9ebtfwdnlGKJJNylyVxk7qOf9BC/BQvxTCIZBmTJWV89c6XH9HxFzFvWOt16\r\nbxTP5zkRTteq+ZsJiV4QiR2xD6fxqat/IT88Otpky2GJebk9IyCGoEX+UP8N\r\n0ZLunohihbHFM+w3P5Bsa7t+3+Nfn+RPi9Zqi2mw2fVPEshey/Ip+xuPtqZT\r\n/KHR1ZHLMeE0d4tro4L8lmiI7IsFoQ5bF+Y4oQECKm5JQZd3Bk5IuF6a3Y7P\r\nlCw/3Q0EO+59L6JzYDtFrUyRMtY/j4vZWXs=\r\n=k3dW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./package.json":"./package.json"},"gitHead":"94b0dd7a96bfe2c941b7130ad735be8ea253b052","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.23-beta.4131"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.23-beta.4131_1651329508950_0.4443792745620663","host":"s3://npm-registry-packages"}},"0.14.23":{"name":"piral-pwa","version":"0.14.23","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.23","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5e1606559884d5e6ea6b71c235d44dc0502d2d5c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.23.tgz","fileCount":40,"integrity":"sha512-YI9zuJ9OdagTHsmGIvYraL9XpGVsYGJZrx+8nAcF85ZZEt/zWoGGZLXGiRSSI1FiVxeeCJhukFR/kz0g37meRg==","signatures":[{"sig":"MEQCIAND9TqRcm9QGxdFJt9HuA67TSJ27VakWUEa+1JlbQuUAiA8T5kAOvYpyjPa0a5zyAoIOhZ4ulnlykk30yepYFTvWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiboJnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+RQ/+J2lnLw8hPuLYmFCxq6EflHb36x+sfD6+/hkDZhpgJ8BPL84R\r\ndkvKkb5enfMhBIDbnIuf6+aBlKhoueVSXZHtCjktNjTfA+a5bBgUDKO1T3xN\r\nIcuJgFkQPlaKItFw6nbjwKC716brPLPqaWg3ZCmJjBbSuCDRBsAXr3xQmMGw\r\ns3AUFFibnVeekoghu9skUapL2MPFy6EKhDgK1oE+WhniwBddBbJ/KGWNI/gC\r\ntySiLYgf5bnnrZoI3nNuf5Y4794O5SJmjTYreEeEekoI/Ll9YDOr4ReLAUoM\r\nGoMPL8z4pAoFKX+Va6D/J5wQIL76RqD8qBgfsvW7BUc2t8KU5v3f5khrFemH\r\nHfwpAYui2H7KHRPwq3yQqjuJxxQeyBr2+9VOIrIKwh89i3iZhPY5js4wdsYm\r\nvHy5aTkTyHfT6zLwCfCSZn27LlyTTMzs/fGtelIaR6QsyJxX1tWRaFY6qRqi\r\nuu/y1ySdA/UkAeuR0jEl8mDGtD+mwxEkA+1zHtQklBXq0cTdewawJPN3hP5p\r\nw3bVfEm3P9cPreBOVHirV/QoTHbvLddNtX/+8GmLNBW1IZ5tCoFMTx3ETFeM\r\nAnWoGqR9Ifj0mcVUNPRDTbJ8EOqlCogJ6SkwZFdBj5FA1LbF7knl6wTCrm1/\r\nnkul8FkEqD8VJAoLlx8Hy8AZtM0FeC7S3Es=\r\n=Rikq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/":{"import":"./esm/"},"./lib/":{"require":"./lib/"},"./package.json":"./package.json"},"gitHead":"a571cbce69564b5d69a683826d2f83a9cf036fb7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.23"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.23_1651409510841_0.24000659083159537","host":"s3://npm-registry-packages"}},"0.14.24-beta.4144":{"name":"piral-pwa","version":"0.14.24-beta.4144","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24-beta.4144","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"100d1bc834470c585afb4895c141078ac50ea698","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24-beta.4144.tgz","fileCount":40,"integrity":"sha512-/HbEuZ6yB/rLNnLVeIJCpmdc1hcrJXwCkk1xOJZtjsVmOB53ba7GWI7Ap5GsJe/bnTXWZbYiS7g8ab89wlPPWA==","signatures":[{"sig":"MEUCIAO69bdGekPArWo4xRmd9R8tnfiDGlcU9O/Uxg3xHjNGAiEAl92fOxG2ONZgXf+VrpnBHckeFSP7EzJJO/UGvTWroNw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicng6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOOw//coen+MKM0lagO7wh/eQ7sNyEvCEulrQlTouV+GtkUzKXIQ1k\r\nzO3GFbcJyVAIo3I2F2pNMCSRkUgoNFCqOf5nUfLm87jUASTbaeyl6TPF3oIl\r\nd9C1Lu9j5CXM2aZwNWYWO3IhjWkT1K9/7Px/JawhPpvVvaYPc2779ZXSPlkj\r\noka1u6V0tjFDPHJUzKFKnjS8XjTHqBAr0f54X/E6L05a3CsY1TY95YoBIg60\r\nFw4tt8w7CxRtF12jC6kTK5DcuGW68FalZPVXeuekOmpAxiVdAL36yAu1DRrO\r\n1Htdn50JHqfl+zHwVonnZ9NLsED7Y2NZqS18gayFjuPXgSpCsHBQI9Va+G9I\r\ngEQQhBkwxrJdwfC2ST3MXfa86mS7WB1KfnhHzdaiOLB2OAprJMxS83jD42o8\r\nza1uGjjo1OYEepiFfaB02/Id8Wh0NTRi8KoprqKYbi5GG3GSFZcgQ4oQddLe\r\nZlfoMDzREEvfwH83AnCsUIHk7KAz7FJHpp3LUsfJMRZi1nx/pzg6KLBo81sB\r\nyJgj5gHqSRO5NNjpbnQvVTg3gfBbHH3LmnR3jN6sVgsh5gND2NHlLgKbVLVc\r\nYIIIfHYXAjDC9MmcWEwmbQ6PMUnDL+LDfIBT+CjKgQwDXUD4hiGflsfDTMMp\r\nfN5LTLZgBumxkkZRMvRiddqYbGXvQnVnEd8=\r\n=TpeC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"b14c6360d67ae6fc0af29567eaf3011d782fd4b2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4144"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24-beta.4144_1651669050513_0.6973467796495589","host":"s3://npm-registry-packages"}},"0.14.24-beta.4150":{"name":"piral-pwa","version":"0.14.24-beta.4150","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24-beta.4150","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4d88def1b96db12c03eaa43dc83916542b6a16e1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24-beta.4150.tgz","fileCount":40,"integrity":"sha512-RuaZ1e4b/W4N8U95up7CcHqXhYm1xHIQBqd4dSNZq0zNFx9Tc/aBot9zSmzu8zVFqpuUFEBlBN1wG/MLmqAymw==","signatures":[{"sig":"MEUCIQDviO71kQKKJxshA7xkuxVF8wc9wj5QA5tuCUqYqRaokgIgX2Qj8dBgqe9SVf2FOoOrC4oS0aTbVs7fo9J3rw/aWP4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicwMpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouKRAAje19BCwD1L+s4RgF/nwhByT/LKVoioFM73C35x8Gqg3xdQpk\r\n4w4FHx/gBqAl9t4Uy1hKxTTXmflZ8/Kdx0FKlhu5+L1eFkTOqYL9MxCNPeZL\r\nIPKdRQJEl2a/MtmOATnG/P2PkHfP9JQLpULpp2LuuSSo3JHmnEJ93vjIaNKE\r\nHMraPUx+8aNjDz/5JQubAlT9EnV9Q6kYoF5NiW5LCOztWcNlTTzak3uyR5d+\r\nyDfJkio2/x4CphTj2gj0jBfZFtUlJGqhEGZ/BwJXmp2E9+awLL7RNMBUDUow\r\nmD1WKPPhghlCrfZbSQLMmShSKaWefglOzBIa58XiTdaqj2XL/rn8kN6Ps0zS\r\nMBKez8LtYTSxFAa7OdPxXxLKNXBeLkNYEkUFsRlcnX+qRym8zYC6cdIxgP07\r\nQmkCM2aiFZz3f0oFi1ZDhvLKow8nMm59xtkXbHFgeKd33IP3m8f09LLkBvRZ\r\nkAXvyqYR2697gzUGJ/XDVAdivt6SKY+HVk/CzlgQ5mRwDa3rmvcxAOkWSZ3Y\r\n167LHsAAEenSQVXpxKaxpAZe3I8LM+c+WFd7PIQoncC263MPdx3Zzt31a1R1\r\nDsk1AlngGCw3+XfUH5D370nG0bQbL86x7mDUcIvDKVmQrOqgA77Ne93BO+0X\r\nGlU8oYQSXxHPGmnsXTar1Mkch8HXJV8WhXU=\r\n=uWkT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"3a3b6461ff039a1751494b6481aefa6fffbf22a7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4150"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24-beta.4150_1651704617347_0.42027790543715704","host":"s3://npm-registry-packages"}},"0.14.24-beta.4157":{"name":"piral-pwa","version":"0.14.24-beta.4157","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24-beta.4157","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1df5053ed298de03b22db9faf85bd23316c71ca5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24-beta.4157.tgz","fileCount":40,"integrity":"sha512-k0llsS1Ou8/3kF0IgH1FzAJwJ2aqTjxHM6Y7KF5tWa6LBxNSompOEgJEF/9CO8a+iWPk0kQSphh951kFCJeSJw==","signatures":[{"sig":"MEUCIH1yjTbq1ZXkYr3VwP/HQtBoHDEZFWzC/JammZ66Y8PmAiEAhi+Gg3HJCRKeRQ/yfwfZc5zv79mTXeoQu/7A8+9gooY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJic9brACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9ChAAnYs7azW+hNxdTGmCViFWMIbMXfrJsQ/vZKBmCpOOtlTLKhH1\r\nhh5sFzqKZyJ6C1GO69xwqpb2JGMkFAcPGpalyiLjL3ZC9LZ7xIcty4hrMd9V\r\nMbNjvsv/CcB+4lg82tu14ePu6rdWXBWfjrj9Azsab/5f43ZqEERZEcToe7T5\r\ntCPnPJFKy+eNQU+keZ2LTGJEHyjSYW4ZSOYTamU9X6Uay5mPNB615I6r6MwF\r\nLqheyZpcuCuiMIX/7CZ3gUrGEciochXpbXSCsoeZlvclx1KgJR9/9ulmjz/Q\r\ngq7E6wvu6gKfa8VeI748n+vJYq3nfmGzZ2ZaYOeDZFzGFbeXVhDjja3liesz\r\nBzhaxUiqHB0bEmqYqevQSwqM0i2/F7fzbLUq2/Zx9CZclGjDcMs3YB/cCETk\r\nuleESyBP0R0NVNyxOVkDKPiwMx0QlWyXh5Ifi5qD5VRoI4lgMSy7YTJTqaIl\r\nlmNNz1M18ccP4oSB14lkGtnDxPHu3P0uJTxRKV7UjyRIUk/rx04s1MZG8fRy\r\nNcVQILXWQu01zkMJNr6eZCae26FngV4fjwe02GyGD7vnLDDg6aG197FK2vXr\r\nrzV+TCSHxDeL8LFTgujDNbzi0kTTgks6PB83gIsy/+9VMnLvaUnKTIOfCZVu\r\n3tvAk0ud5hFopAjH8IBFK9WMKGjFDTboEFM=\r\n=SOGG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"5a447634711daadfbe68b73396cfe75360070f2a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4157"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24-beta.4157_1651758827135_0.3593953837884589","host":"s3://npm-registry-packages"}},"0.14.24-beta.4161":{"name":"piral-pwa","version":"0.14.24-beta.4161","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24-beta.4161","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"61481d4279bea1f97fe4863e82fd10aed37320fa","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24-beta.4161.tgz","fileCount":40,"integrity":"sha512-sI+7+/lxwE8wmkvWiNJOJgTUZ+TX6l9OPCCSEf/Gx8RJmBhKqYATZRLA/uLhjbzA40E2KYrtpBpCNbo+6N80XQ==","signatures":[{"sig":"MEUCIQDxfmJPXaxRNA5uIwzU8CLY3G5SHvP4tsXUbekH6yQp2wIgIVGAEYJ72b6QXhouXNvy15jKvYZLs3+x4ZDScGbJWHc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidTJJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKWQ/9HJ4yzlXb13gMRba3FONA2rc+ckOMFTmEC/x3taZXXVqXF3y0\r\n9ik74iGI5fhsS2zdxDzRTicUIFamm+Ep/TlzZXty7wzL0brIMzYI8VpSSrux\r\njIak/Yb16AtnKRpGGYsHjxr65IQ/IsjgyrJFLTgLfEMbv4ns2+aBa+q4vs3o\r\nyHd2t241YIKggzAQhZLND36cvyqZLU/dd8v/xjMwlCqkkevbyoXdmtlPCg21\r\n5u7n/50sgtKwxk4ExkR0uA/hXHKNvA9Fi+qlkRbNdvMg+PxZVVvhhRAC2Vwk\r\nQFcEfoA5S1YBqwPxxhxJP3TTA5BRqCLwio/sAZDwUQCKvEZsBEZZATNCy0t8\r\nSt+Oj+znpAZkoxiqf7Niwl23I7mecaBHW1KpSWqf8+Xfdlha6JlYkFGMrZGj\r\nbhl6r6iWRVFjju5gIWJAgW2qQp10/2bWMsbB5Ifr91keB32j5Oto3pNpZpoL\r\nUMFszY0EMPoLe6qQLbD7B5aCLi6h/ljiYU8rHtDLKdMoUhNIdOsp7+TaEvVf\r\nSrKFSgfo4FdloIogtALb8fSmSMt0Rq9f8ZvL1bEQhYE1zz4uxVq9Y3D6JaTz\r\no9/MMoVpy//mCNq/64qoGEQcFZlet4fMftnmCcsUbpCco48xSM95I7VHLukf\r\nfQBeerUDk1YirATggpweEZUFmYUeeFDjwic=\r\n=MxhM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"a3e3fde68f96231ad3a65b25b90d358d2648fc68","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4161"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24-beta.4161_1651847753353_0.35178412553550786","host":"s3://npm-registry-packages"}},"0.14.24-beta.4163":{"name":"piral-pwa","version":"0.14.24-beta.4163","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24-beta.4163","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"38bc8e6283323c4b26cacf960993194079692c45","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24-beta.4163.tgz","fileCount":40,"integrity":"sha512-0JKfv4vg2ZEPQmgeRftMcVEjwXzoDozLCGVUeflUY6nOPNSbIUhWgj3AYjLvcHgxQDHI+JpBViibxpr31SfUeA==","signatures":[{"sig":"MEUCIQDMUIWNlmZRQKTuf1PoIPpD7V0CTVaqBr5T4RMlw/ZRnwIgEi8yOI0+yZ2JX+wZvoBKv7NHBZW3wMswen+7BJm2MtY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidba/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmra+Q//dWSrTdAhV7dQKyZrDPzLK5MY1Gnt3muMEeDKXmbriWvYvgqM\r\n+clWki76aWIW4PXVbfVS8bYEl7rwJiNrr4azGVqfv/wUYZab5m2xCq6qUkP0\r\nBChOIr3f7gHQp/XD+FRsjQueLCAe/DgNmwJP8SYiQQnA4ZhJNQxM36O5b1Dz\r\n6yuANU7TJSpxCTYdDWBNzVtSV6vxQwW1C2jR6cFWqAreAFnJielgDPCfUlpx\r\nbbHx7+L5S75v55XRtEi6P8wzx1Rt7WXUX86qgJKZe/3HbMIxJ8QESQEjxhKc\r\nbiF5PqDlHj87i0z291gWYSgPJ7RI5/WH8oPjc88gFy5R1XJHa6TgsXvhK0be\r\nPMH2ON8wBQZR2kmesfu7F3sqvbIbEi6Hq/T2r0z7h18l1KntehnAKjEETeKX\r\nFRD5UxpWr3RMXHY5Sbmz8oDCXcWN8B5cHVePhOOZIMVJAgjD6kd13gJ1BzsX\r\nRCGPrAT0rTjvY2AAaVan5oBcPWW40RB6LnFnG92hXH39yMLMgr/f9V/SMiYh\r\ncIjl6kT4bTyClx9sfCYtTJo1PFIQZjg2xqFbKDElTnfIeUxKiNfcPyaP6P2/\r\n9Y2+xdPvA8df0dMr6/ZN4rpOCvqBp5nRabncy//Jct3mMGPU7YEkKYG3SkB8\r\naXN56sR3bBmq6TfDb0fdR8L7MasMfbUyPJI=\r\n=XfFc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"2b95511ed75a140e1657d7791245cddb3f57f9fe","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4163"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24-beta.4163_1651881662958_0.6397375519779396","host":"s3://npm-registry-packages"}},"0.14.24-beta.4168":{"name":"piral-pwa","version":"0.14.24-beta.4168","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24-beta.4168","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ac025fe659cb592af3c584f66db9fd0895320ec1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24-beta.4168.tgz","fileCount":40,"integrity":"sha512-/YNjz6/l+rrbA3BpeEEGFlBhsiaf6DyupIV+DTPQAoGZbWL6d2geKozXnzgdXK9lrDQv92XVQ6PmVb0+icdJuA==","signatures":[{"sig":"MEUCIQDAAvtdQeUdNEd7VvjgxHOFMXZ15Bg2/0pCRmowvKCRLQIgTZ07Hwhgf2ETgdbGr7qvW+ebJIBdziV8r/KL1QjSY8Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieRXVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqycQ/+MFaqhJbLkCu6iFugPBBPlIN5gFjIaY6wyJtrzcAyQv/DK2NO\r\nf8fkrx3SaTSc/zTATja5qCL4G0kSe2N5lbzHYAlSmGa4pG3iTVoBWoeE+Ml1\r\nEUd0ATVNtCxnxfWxKVa5KyeqTrIe7Kb4dFLJKR3YehXcur7mORLavmLO2AUh\r\nZoTVE0OQRND3Ai1hl0tbCEsWcnpz7avipCTVFO4vXFm0HMJHSAe7xMQLueBM\r\nu7J0s6tH48+yT0/SXexSkkJ3ZmZq9yYmD08IGn2TKT+drZRfiAFLTDaQB+HI\r\nwlrGLHYu0vIkz1qbQvCqhRgvtgM4csmrqAAz6JeMs8KYD87ab3sIXBkzFbOa\r\nAjxf34K4uMZ2XnZ+JY2II+sYBHqEFof/LGIPt5Fk0ohXxOWmotgxVHF/cfOj\r\nEiuR0rk/aYrA4TyFhpOYYlRRmYBrCvUXXRcTcvNKcfBI/mnvxRXIrXWDQtjX\r\nobwpyTrRpw2WrxdXvHSHI0bBWw6Se44qZp2we2V7WnFONe3dLtlnDd+OqgE3\r\n79EaSgjB1CCvKcA5HbT7JE8r8UTd3rFtHylJ/zK3/eO5IAdL7PBoH8fYdkI3\r\n4p7idO8TwpJcg42TBT1nblltPsZRlyeF07VBl20VVw/hNZ5sLLl4YYYH7rXn\r\n1rmeVYgfho2TKxR5Hmjo+rL3VXcA0VhFNnA=\r\n=fTL2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"5c3d75e1148d7def9bbc0d5c2628671c2356f816","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4168"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24-beta.4168_1652102613621_0.3226789565239241","host":"s3://npm-registry-packages"}},"0.14.24-beta.4171":{"name":"piral-pwa","version":"0.14.24-beta.4171","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24-beta.4171","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7865da89712d152b3ecec4d9ab7a10dddb3df4de","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24-beta.4171.tgz","fileCount":40,"integrity":"sha512-LbxKl8q+GtLoogbEIjhPdMdKOKagArf8F2rqAQ45DmbL7PlOVGJLM96NseJVPxFW07/ENVaKB1mkGTV3haU5/g==","signatures":[{"sig":"MEUCIF8GuAUiaOchY57PA6RoefUwJAOJPm2OLcEDr4DVixtoAiEAl4MF+JLNxVy2N4Qfyc5eKKn4THkruVY86i9WeCxUnHc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieUcEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobhQ/+LYhoQPjrKgtpas7c7gtFZfQA5u0UY+LTGCtMJ9G6y4P0mgZ5\r\naZe0sHgysUVunwcDmnF/HD4DUuydL+N+2pXI3EcfIOQyCnR9F8lvUSGRsenZ\r\nHxniviJPzNLRYAB9PY0EP2peE6BXGrAYuc/K6b9DxIYTsFhL7TgWgsMXeq42\r\nyCub9JsU2AsNeLwKNPRVZfFBg+gP7xsQ86dUCIJLwUEI0pKyafDmwYWRM5Qw\r\nReyNAZ5JzY4GSWMaAFKJT2Ez+PXAADIazqj/YQMJz44BAyZCk/UKvsnD8WRT\r\n56YVkzvwlzgY1cWI9gc7QZCQaNIiErhM3hidYYAhoy/X+BUvjRocJUB8nAzx\r\nTiL5bgSAOO76/CFN2zjbNP4QetYGU+PxhNUq5HsbBXLXVtB7AITEgh0YEu/l\r\nZGPl3+G8YaGvXd/K2h/JfO7Y/T2XfRwkGukZaUp/GQXfmHHqxh53JeFNL4U1\r\nrW9bRVmQ0PD4PkjIc3el1htpyUmD12v2rwJK1fpCEnr44EDWMlyVZSad7skM\r\nuQmTfztTdIMeLjcGYDhqv5FoQqGxJ7o82Gq1D1PHfcT/6kQyoqdkR7ppDpnf\r\ngqMXexSnGmhzoaQ/UoBWnFYvJlWYuJENSW7OSTqQjDXMIT+XLKi2VU+nyW6+\r\nL3R8RwuecU9EnEdUk39/9nTn+W1FZ8Feewk=\r\n=k+LC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"1073f96f7199c1ca5b64cf3bdf9d06b6be60045e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4171"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24-beta.4171_1652115204375_0.6755438035501471","host":"s3://npm-registry-packages"}},"0.14.24-beta.4191":{"name":"piral-pwa","version":"0.14.24-beta.4191","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24-beta.4191","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d0cd9277faf0fb55c3239d2d70517e35c291e5a4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24-beta.4191.tgz","fileCount":40,"integrity":"sha512-ErHVLNGAWWCzRPVaaWHQM2LLBTEqEwmxlCgIaDvJZnP7VekrrMBvaeQHN3Gq0yGZgKzLWfOOHTO4plViRQt22g==","signatures":[{"sig":"MEUCIQD3aEiTNgtx70BKP3rMxCYlPzCnHhTe1xzb8sM+Y3NsIQIgNkDAEHaSKXnBBuJAUt4/yph6D6b/S7I43vbfxCwbe+E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifSeoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpL4BAAnwCn8HFZL+f9rD8J8u+LpI66kouB3qptASjbUywKYCNH2gzM\r\nMjObDaX9FjAdzTcjfSni8D+WOk1wjmw2R65e3l7ciFc439PQSgoLkfoeqV9G\r\nplbbVg3o7eEcIxKbPlpBw+46nzlBNcSOc45d9KzVkrnS5sBZcu2bw4pMTPa1\r\nlXJHoq8a9MCrbzTKksh6Cpih/CAAnzZ0WmrLRyKJleS4m6ss6uJ3Qh0IVgyu\r\nK1ip5IU/VKcw51AidW8X/VBACtNeadWn/VXTynszBnvwLlri81p669adS31D\r\n9ei7fvuxSMaMYMh80IwpxNWopwl37Df5XCyZBG0l4qQ50FQHUyWWavRkFiZj\r\nxL4dY5NfHUN/EvRiAPrPCiZ0DpYdEYpRaWs5ar9L7sST4isAx7O2R0naLApc\r\n7k+OczxrklO0qqyyeB7M2FgtRGXfvs5cSJ/a6Ml2qBHNL9xrZ+wAYIxjMC9D\r\npNfSiEUHEUF53aiakvfVGqKEjJNsM7Tf1515mR/bWECRR4wYdqvzwlvg1NVj\r\nQ4Yc1//OPX/uZQUoEXzZE26ZWJ4GfzW2Qpr5hUUryxL3tKjL0E8DCMn/Yfb8\r\ntTgBVEfL7G4CeeBA2ZiWfmqwdCehh2gqmR//iZMOAJZ0o1YarZBM0kxewNxb\r\nqZvNJ5+JC2Y++mvGuUxH169xqXZUjL5ikHI=\r\n=rH3h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"ae605bd9075d6d70abb0c159521f00aebcb6ea4b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4191"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24-beta.4191_1652369320177_0.9607869404024514","host":"s3://npm-registry-packages"}},"0.14.24-beta.4195":{"name":"piral-pwa","version":"0.14.24-beta.4195","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24-beta.4195","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2c16d67539c7fa3887a640ad4aff0a45d36eff2c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24-beta.4195.tgz","fileCount":40,"integrity":"sha512-EqSoetiYioYJEAJbRPcU4qdeCiBUZZISa1fuWZ7Y6Yq4E/2v6sSc85+VIefCawoW+u9h//6E2Fa/QuwXFhumxQ==","signatures":[{"sig":"MEUCIQDSR3dng4ycriVUOfDaXlmKd06CXojXZJ37RgClAzzoFQIgUbQyYG7GW587H39j+nNbYRjaxPE+RZtvo6JopenrIUc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifjEbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+RQ/+PzzqNepYTJDu9Qa+ibJzsQtO/t4Nrcfoqm0v523KvHezLHKg\r\njVpVQ1VdkzpknqItwL/VivTbrWGJMwfzUA+G92dKBUVJGfy5l0eKvSizH/Dz\r\nnR9KdJv/fNH0sj7CwLpQk2xQHWiXpLBsOCUFZix5Ds/JsZy7YMKzlyYTerFa\r\nCVfTY4oh7xZR5V7QnOTYBZlVTeQO+P15dX2oRyvn646lFnIMd4e5OTttd1V1\r\nCdJGuK15nwJljopMdCBMeJZ9ARq554viBt2kJ/i9OkCeFkKVVTY3+yOUGKvx\r\n+XdqrB37rJXkAmZJZiosAoFGv4qjWED55JxrQMMXyT5kbmWT4PYpmC5Hgptl\r\nhCXr8vzqlJz6/6L5dA9Bg1Fxxe0Rj40rFt/KeLaVtHRSrgbbtMNj1qvrENaS\r\ns3RzyLOnXxFMvmzFCQPC50VrYJkKK/Q9pD1kRCmiHlcANId0rb2jvSuhz6Zz\r\no9uOYYWlexr1kNPWqb7meFBqChzmlcRrHpbhrb9nGUdvk95GthSGDFDpX/vR\r\n1pKGPxFjXtr5rKBS7hC8TlSEmm8E1g7J45rUr/bvYoiIydzJnNYVX0UWFLej\r\nyRVPgY93lvwhn0vsxqmaof6oJLlD5/7oXv7Rg6TgQbeYTs9jEu6vo5HoFiSF\r\nBmw/GotkeO6hDvWQuxgAggCgpOpKZ/RWwKI=\r\n=qZbC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"c1bf2107c0d0330b5b93e0aefcf360356642563c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.24-beta.4195"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24-beta.4195_1652437275778_0.952572804245706","host":"s3://npm-registry-packages"}},"0.14.24":{"name":"piral-pwa","version":"0.14.24","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.24","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f298c2e8de6be09877cc79cd4a9b58940ef0770c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.24.tgz","fileCount":40,"integrity":"sha512-NILRwbI9RdFI8nMCSYOYIjTDhKzSaai1bpX5H5EtN3fUq9l3luIjIT/UUT3dyqP/tTSyOkL+TvWtegb5VmxgGA==","signatures":[{"sig":"MEQCIHNLyqXUn985HQm3Fg/xTxpGj9k3U8VChkSzsZPhST5rAiALIl1yomAQ3me3goW4gEFYZufK2YEkh2PKKApkDgnqoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifmsoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpceBAAgVAPRoDpEWJ3WuvBtLnphR2wU4a0QY0H4xEqUc3/aRGv9ZoW\r\n124FUcliyxNAaHogQ1mY0yp/PwcnZr0tBZJ1p+pJa/MsIC4DuRHbjLyE7kzV\r\nWlSFlFyK0bNrh4KG4i5lOZ++iooXYgrOl/Py55qxwK2GbvPvBRowv6SP7j5r\r\nggfNc8nK6jHsm2RB/Diclsiw1iCr/tTY3XImXEgDjD3WDcxKPz9bDV6zy/ie\r\ndL2Ps6bzXdO0TJLUirqS8S7ApiV9nB91B5qrjrhUj96FJqnTbX9k+K3CjzUC\r\nMVax/jJPT7nFn7J1Baj8+mMsDEkQKSmT2It4wYfNba2gsavOuNHGn9Haduq1\r\nax+fBWTECn2L8fVCgu9NLmPBSaYfDO1ZOdpX0SMrmeHy3fMJkCFUGGp1IYC6\r\n7m8PmPKaPvchWLOlmEHvQy1eUpHm0VfPqHzMgn0DF4ic32mgm0Fyil+H0+b0\r\n2R3KdC+MPjwcCzUuGj7dUmuUgGAFqTIJrAK8WYJnvXVpON6Lgo8yXHzB0pLF\r\nGT7o8v8mDH5+YXuLtDh8xY8CcJBNfq3Rj5DrT84zHTjCn9EMCM96I5N1Ko72\r\ny+BATVPj4CuwvrUZio0HSuRqqrbV1mWI0bZPhbVe4+0DJyM93fTlT8xZ+neU\r\nKXuy8cRwxg9/lm+yUV50iIiyyzrnr7HZO3w=\r\n=LY+F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"a21f63e9ed351bf2040afdbed1e12c59d2ca8f15","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.24"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.24_1652452135925_0.07758661003269829","host":"s3://npm-registry-packages"}},"0.14.25-beta.4229":{"name":"piral-pwa","version":"0.14.25-beta.4229","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.25-beta.4229","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ffe0783ab9a24e1a3567587c07347f0df60c1396","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.25-beta.4229.tgz","fileCount":40,"integrity":"sha512-+uuYKs1YLkAIbMhIbW09RVMx3v4jsoJe1C2JOSW68e3j0HEG1Zu8EsTNgxlUkisLABMLe2PHEhE92LDr4uIc7Q==","signatures":[{"sig":"MEQCIHTlARn72SNJVz/Ic9xDLlkv19dw7G2l0rOxcSZgyM3yAiBHbW3rHkSQ8jUA1N+X97tDhtrxxxl7aXKeyry+Djhi9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihsiEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgFQ/8DA16r1GNDbVuNPJlziHPJO2ST8bfR1odOo1LgnwGQUV9aP0o\r\nrJjPCAsexJ2a54ox8I7R6BTN/UCcQJgRjEVuUhNuMOpSoAlry0Us7Ca2Bi9g\r\n3C6iz+jTHbUgA7VyS23660+sqWzN48LsiVAIkJLupLLRV39hmmMM+zT4/HcD\r\njWnxW/L4dUeqWR7wor+z4VZ7wqw2MXZCPkaatAWg05lRyZypHCWQjhk0Dgh9\r\nM9sJ49aRAXf2Ijf8DVT3v2WBtEPrnlZ6kfm3JZN1FiThYb24Or61pJSB2a4i\r\nxyY/i3wH0klKHFH00n/sqX6NWwu9REI/Ec7rKGBeRi0JX3Or6HSOJ+SnAp/7\r\nMeG8/yTlWp0FTkjZ8tSzFiBo1/AD9cUiNiNDAiCq5fo2RgFIskMbkxz6Ddah\r\nWB/Y3wo4kPLhCaP8I/6Lqf+w6AUp7PqwxSHdmpFNtYK4KEtxjajY5Z0cnftn\r\nAL4M1H7iUA20eTabjTWXtkDa92UCxrlGeb6S3WW1p9MpnzJhstmMAwf/VFih\r\nFdych+TX5FWHYSk4oQrd94ha7hcF1O3XDYqXcEeuobY9qrOY+u2yBuUd/zqD\r\n6ui5v+7Tyo+89pQ0DPRE6Z84xyJy+1sT+lqKn0pTlTQA18FHf+o0Xfev1KcF\r\nwCU8IL3g9QxME2UcwSTe71Pz5VwJvXxSpmo=\r\n=trNP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"fec92fc1eb798baeface15b5f2ea9bf52ef404ab","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.25-beta.4229"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.25-beta.4229_1653000324371_0.6465144631520581","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4231":{"name":"piral-pwa","version":"0.15.0-alpha.4231","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4231","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ba5706f558164ebc81a1defe998f7b7a022ad908","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4231.tgz","fileCount":40,"integrity":"sha512-zsyS8ZJSKrOfcW8uk6uhS1qcbqNIA9L0zqAXcMOWY32bW3ZIv93ZJnHhYjgDtOCF88Eb4ribm6225IZw3NefXg==","signatures":[{"sig":"MEUCIGmtSfQ5lNpHq6pCOqQcSormkbQqbYemmQkBtmfJc34wAiEAtZNOVOYz0fbxxq2FlNGzinU7IgqPwXn8i8JTiCWmXgg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihsphACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZrA//bPzJ1j5J1NpkVTPTJxhvPJzRrNAiVqjivt/BxTewnCRViKWT\r\nDg79zkfkmCpRSdE9Ozxrbr4s+legJTq+v+PPbRj1tRAk1LuvoGMeDNf15Ss1\r\nHDWFKujStbYI6wCm+74WCh3a1da+/AuasV0VoV8BOcehyHAXB6brg5qdxl1r\r\n7sFn7IN82UBL9SsOpeJooBHaTFP9tSagQ+Icoay/a9qhqaEwjDpShkmquoLh\r\n35/gyUWllB/4FQVLDR1seY2d0rgxmp2U2grIj1x2pFmc48wZE4/s6LdeBxBF\r\nj5Tul4t0S8jkfCIcB9/ogc2Ck7lRNCoGqiTYutR74+ZEUT8Oxdvl1lVYK2x1\r\nQZWyzV4l3DfNOsHASN55T8KR28oNUgKgJEJvDMCL31Lsf5s9sSkc8ajkRJxM\r\nG2uAqkMqJ3e17UOWHqj+wM1R6bcKdwd0ssY8XT4Ry26Ln1ENjF9OaeP1Uw3/\r\nCkIyUK301m10cBUIujCyEfgLlfll0ZnpzEJflDZ5SN437NFphoA7O6sctWk/\r\ndHuDOQUNPexGsdMSQfG1Q5vbA86lCIHbwzg8SsvY+0Lyw3iSjgCD8htT7xE0\r\n3Pmn91+gTjDVSEDolF/G+Wg8tOYmeQB6xDiigMyuuOwuhIzGZfj9LzDf7NUo\r\n/wYzj1pgp8dFT33EWBYAftixXUcWeNJWoLM=\r\n=FTXn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"4e7f158bd276d82c5bf2c19d47ccfb3604f38e38","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4231"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4231_1653000801455_0.16607229939317514","host":"s3://npm-registry-packages"}},"0.14.25-beta.4238":{"name":"piral-pwa","version":"0.14.25-beta.4238","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.25-beta.4238","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"211b26405ebacc065494adc003e83890d4dc723a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.25-beta.4238.tgz","fileCount":40,"integrity":"sha512-Ojn4nsmig6XPeVVF8qKwIhQL7J0seQvfae7CoordgIrrTiqXiNlP9LzhCWzbuT+vzx7rxSjms03udq6qnbk2hQ==","signatures":[{"sig":"MEYCIQCUxRxB5qQSP17bQyB3ac6lPr29hmAwoWyQ9qyU1KQnNgIhAI95pfdsXZZjaCOcMzIleEkr5fELp9iH5ezsKRO/ES4J","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih6H0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6tRAAkEuKq9LTtCG1VfTNul6QB4GOXPKlaGsJNruJKUDN5P22sTzY\r\nxBysQjR3qNUQrDUccpp4qtAQUVXRdzz3MnHfRL6zLScuYv+a2xvwtC0rRGLD\r\nfINxYTJVlH9RR58Pj5desFtI6lBuXRIwEwAI5UviDXb1F+FwdGZ8HDmSXAcP\r\ngvc+E1FzVa6O2Hz8WIc+jiMvEMw4g9AXLgP0vpir/Pryt2ZXE7b08QpraGH3\r\nj4Jg04qBxnQdp63h4Kpzo05jPh8b19sR7Ri/P9Zkxxl512Mxi+XQ4phWqwJO\r\nCqGuUi/BqpvN12aUQAXAA8wXeKThOYxW4WQzy9aK3iY7O28JKk6QmwuXmOK+\r\nvzziAt5iiiw3oDl7HKALy20xBzA35jFanrTpjfOq0vHrYtsjZ1TAzZzwWJ8f\r\nvhfPVyZyF1E7o0dMFa8SccmuEFwGNM9ztxtx1rLGai9Z3R3RpigqHoW5Tses\r\nC6t5yjsb9qNGOGr9dqK2/+KlEOXnX8yXkf2jvs11IrASfQ1qeUt0/NAblGgE\r\nRTwbRKbtharKYa41rbaGEHwa+xNJ+i7hGJx55U++sif044GPHDq0xZzRiFD9\r\niKo03XYm84yovmkO81Fd0JeZxCpC8f3wBvIADccNVady1GfE6cBeoWJmLTu0\r\nf0jvOHfUvnWes5fef7eVujn89bjpYY7R1j0=\r\n=yDKW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"de6aedd24c8b3503f89a175d3c58a0f652cb3b54","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.25-beta.4238"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.25-beta.4238_1653055987786_0.3706010973555365","host":"s3://npm-registry-packages"}},"0.14.25-beta.4245":{"name":"piral-pwa","version":"0.14.25-beta.4245","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.25-beta.4245","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9a6ba3305784cb3cbb22aa6433263cfe649cb090","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.25-beta.4245.tgz","fileCount":40,"integrity":"sha512-/LRePs2jPgqMaw1cT2JR3j7XDmvDNpwp2KlkxdO1TpGK8gpJokSULbOnuVtgGHvpDZgaiYiru0qrfiD7DM5/jA==","signatures":[{"sig":"MEYCIQDA9pki9vmfHR73YR0gE/6q3BCmrYWsC9+7gtIkiRY+ewIhAKPkeqOP7PfluNGkMDvk89aKalaMs2lS3W72miv8JZlv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiiW/eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+aw//VPyJVU6lHVmB7349hO1j6UoV1x4j8fY8KiLlwUWs2D9aSaIY\r\nhwC8gEFL+JRxxYSPKJum1MrjBOSTSWeB3T7XfHqfQIM1re55IyOH43fhsikg\r\nOs7DQXBfFn9oedDdJREpWeA6gv7Bb3P3AVH7n1FJ0Jq+fwZ/BL2k81p5glpn\r\nsGHkclz2E7QcNQYjFRne4AzvBSzxsJfUuxRV4vrArXNv6i/nvrFKBMX8vuGL\r\nKAfQubbX3W1W5GXI230Mqu1rhh8eeATGjMHdRFHjOxZlam5eEG5n6PxzNGID\r\nWbY6o200+2xF6CXadNe+Dh9FncVdU2Js4OP14OT5DQh/PawJokVoR7g5Pxar\r\nCDD1cUzVG15zNHMNgYhDLjJnbfx5b8KGg9NmSZ3Fskr8an2W6N3Ke12gptWf\r\nlocACAN+Y8zmMMnMSig0ecrvjGQHVZGoqsceN4FRy93wD0clcqhOFVPPamJQ\r\nbi7TN5bC399vuoLx9ZXVQIlgLJZO7/SbE9lBXWKwZQsjZ7mpaAEGLmopg7rd\r\nOcZwkc0/R1yD+DV/oU5Aahja48HLkEPguxpUxeyhe4Pw5YXw9+WZQqI+T36i\r\nU9qxhm/iyk3hC3MpQyqJx8y6gWalY24C1vRmVYXg8ereCchlnWm7DUvpkS8Y\r\nBIuD4R8PA/b9KZSqwjKXCS/cgX7FzBiJinU=\r\n=NVAS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"1ab62c6f6d1eb4442c866882310953c2a67c5998","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.25-beta.4245"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.25-beta.4245_1653174237966_0.47078137660950015","host":"s3://npm-registry-packages"}},"0.14.25":{"name":"piral-pwa","version":"0.14.25","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.25","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f475f6682707c09ed7a4c676d4f0fef064432adf","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.25.tgz","fileCount":40,"integrity":"sha512-Iuf0igmvLJdor1MJto/bXK0a0Ab3Dg0dNSMbu8eJnycHRpOJ6tfSQijAqVeqxneLYLr8i/NZ5moPfnfpIW/9+g==","signatures":[{"sig":"MEQCIB8EyrB5dcX0uDzt0iftmB00KqBEPrjcWXGkW+OQbg8/AiBpwpW+BUJOSO9Lnz8rnmX7zPspFJ/rWDRSs83nairkMg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiisiuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/NA/9GOuP8oD6WAqwOrXdn34KuEmsEbORy4/oIHcvEMRStbO3lXMo\r\nnlbdm/i7weiFk2VRu3QxeBDshSzx/7ubYHpQZI9kwmxRQOtr4LXP2gezdqWY\r\n8sshVR0K4Psdp/UP7tOPuAxcz7ZnXc4sPCvOT9cSHfK4sfBRTypgNSwU1GY/\r\nuvAB58nGXzdZrthVRU4spl/Dyk9OQnWlDinWyGlvbi0SeTP8Oe/9eBswWH0L\r\nF5srD+Tw73m/HUsldiRO0MJphMOEHWhaFtfehF1vr/plsrWtnV1a+YDrOJ4y\r\nVcEFOwoMUnX4dec8B+b323u2LMD5TIK4b3DiTM+9s/6Lk84N71Q/a4Xcejlg\r\ng1sOExO7muV6cBcM9G777dZZSLd0v6zL/wk4sIJa/kyYXFihHihwMv7FE8OS\r\n8dE03x6pmvGC/+v5LKilmdtJCZ0FQlsjt66LLnNXGWnM1AG/s3hg8XVUCreQ\r\nMqR4Ru9sYFxnk1dgnpVOc9bvyY2Lrj7QyitWcLYiHYSi0spr5ycv1yPXHaGf\r\nyBkcQVMYsg/PS+RN5pMOLTC1B2qSD8zKXKUbf3JaYEro3Kxc0XxPO1ri5nc9\r\no2kia7GLxNrLI1go3L8AEmuPQ725k5Z4cejcj6+k0H3LYf6muxvyy8zoCuDS\r\nMpp5pWUwFIdx3Ph4S7ubER8SO1YCD0vF7fg=\r\n=hlnX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"87e857039f4f1ba5dcb80bb58e2a0c595fb496c0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.25"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.25_1653262509958_0.17358001145241442","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4257":{"name":"piral-pwa","version":"0.15.0-alpha.4257","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4257","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"46e5b09c70f58b34f997b85c9d2f449449f36905","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4257.tgz","fileCount":40,"integrity":"sha512-K9pY2TXcMyTrfFjSxX0q9Be3cM/o0Re5/C8yfBi4FwYEW3wXl18y7RSI75+NtoRqw0JF+M3O42N5fGsa3hxgoQ==","signatures":[{"sig":"MEQCIDYlk5y0H167E95UF6mrEvKsJwP/Lcr8fV+pZIRwgloGAiB23/ys7K6CSIY3epD91xyVXZsXxhkFhMMDPHlwIcZPSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijPIIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAKw//aECvXxn5M7b6WTr4KoqCha8WMBolWsAdiL07ONG5uGOJvcGB\r\nB5mQS0hFYH5sMCitZiCctDiiq/qKAxITBhoq5Cwg+ggmdcJsaVyoJFRRtd6E\r\nOmoETCLGj3yCFLuytqYQRoJvQIDinIbIPwd6RLRDDG4/R3WriPoHHbHDfzQe\r\nL3H/JSF0ADyeQrBguC3X2S+7exXX5UWBfgN0r3T8XVyv+HhiYK5y1lepFDtc\r\neG5Q1z24pPKQio0pMmIrYw+825yJFkEIw/rTOef3Mvj6yB+k1wSWSAej9vqp\r\n1ODzRAQPoEL4qoEHMWzZL0V69v7XMeB97lEdJ667q1VscDK10EV6XEo/1l/r\r\naApVfJolvZb2B/RwJWeMRQZ/veNjfT/UTdbRvudmCprzQg/AklNyiMdTmtdM\r\n99hMaghKO3K+ie+Edb/5FOO/chvGiAiOR2tRDp0goNqns6EQacOD6GMYAjt0\r\nyZQPiUhbEVIGC42SSWilh9TuHwZ9jqMmRLRx1zVTYBYK3/B5z7mQlK3h3MEC\r\nKkp8Yqe3qL147WGarvnIXUcPnpJ606H3H0CjuI27qMa3ffQ8z+izSIA2Hlwn\r\nssPXobEyvxJM00HJr34jZEkMdjwytWQwgDKtYEDVocMUWLeL0b7FSTghF/Q6\r\nuXe3kTiZtQQ6odvQd9voi6KzhpiEEI2+lTw=\r\n=bikT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"61f4ebc7b6c7cea553e2159b075cb761216f8e85","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4257"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4257_1653404168268_0.6370023260410478","host":"s3://npm-registry-packages"}},"0.14.25-beta.4266":{"name":"piral-pwa","version":"0.14.25-beta.4266","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.25-beta.4266","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"579a96f0ca3af8ee4e5136802c904af0b6773d7f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.25-beta.4266.tgz","fileCount":40,"integrity":"sha512-6eGzNx+Itu9Az+wvJ6/mkWf0uopZ1EK87WvORhGLpolYRZJ8ORVBRZ5FHHVRvHkyEGIV/5+f889BiO3jIGeW9A==","signatures":[{"sig":"MEUCIAlZe1h6WyyMyBpIOizYeQRJfnWBUW+9UCTQ6fxqX5USAiEA6SNBfBoo2hQGudazPZniRxSnBORDMTEhcu9tQa32lNY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimGuzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0vA//Y9bVWRkdGnxhC5tAnU//6YK6WWkgQ/TEYpJxvqP4JkZFFLfG\r\n4zbsHpeOJWfQj76d7LJKJVABSS/1xzNl0rr7yYA6NFYGGzBtDYMBmeImyQPz\r\nDfYqcaXvMDg1zohjcNhVkQP8TV47i58HxAU9cNzYZoi5iGoqILvS4VWKEt/r\r\nGhjB2pNEZ8OyhMVhdKfcj6gV7anwNT4VNHE5WzF2ER4ITgWTa+aBsTgcvImV\r\n9+j5SMGljr2biGBgjpLmyn+pObYA0e/v17mHN69csCEyOBfgkZ64Lns3KHzL\r\nCLmfwNWy1Mb21x4KKszP2V+fRuL2zcILarHSRq/M/PltvqExk1yH1ZabERcP\r\nBvCOzQT4+Dv1aV/FR/CoqjPti0OlQLvvKSLr31IIrIowt4PRR924N0JGD5Ym\r\nCCQ1EH8Nzetiwbd2gsRcfE0ao8NfpPULD/DjUabMHsYc99h+vjR6PgRia/bH\r\n24FcBmPf/TrpKyNxpU78Lm1sc7/qmL6XnsmkpNKKi/jcmidk3qo5Wr/pAmvy\r\nvSzHlisRhz5JSsr7B3aw3BKRUcb8DLpChyB8IIKONKwu9kUrUxwVuBpTg35x\r\nPY/bqC0gmqGPNvm0g5Vny8E5i7x3sw5OF9glrGeDYwztEIrFis32Evffgxcl\r\nmnifHNm7gE+k1m2djsG93IUEuEevLnU8xjg=\r\n=YDBW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"6e3235a5a6d27ea6b9f0bf178951642824d6b3b5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.25-beta.4266"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.25-beta.4266_1654156210977_0.07567590986224948","host":"s3://npm-registry-packages"}},"0.14.26-beta.4273":{"name":"piral-pwa","version":"0.14.26-beta.4273","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.26-beta.4273","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"21841f18d67eeb4d975e307a288301b3b82d40a5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.26-beta.4273.tgz","fileCount":40,"integrity":"sha512-0A6eAbaItDgsACa5Bl17eLdCDXP/TtMv1M4Ty4998+FWj9w1S9XY5wy/AaBtTELUuvguRLbxMfZ84PBhsuc7yQ==","signatures":[{"sig":"MEUCIQD439zdJCgG+BTJjf0oBoy8AtAZv1k4uMqa7XQATFtmNgIgVutn5mhrpn358HIEbxThxNu+DekbuYfXJqDHW+HAm5U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimwYiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlZBAAi/VDP8zjsdh8p3ILC621OxWBuhJUQ+F1pYLSPU0TmKT0vMt4\r\n2G9H1V5ILKBFzOTI+4m+nLmIJeeHyW+kcNFylvZRnrBaTuTD/WC/QMf7uHqm\r\nJwhPFQ90O8MMkYTfT2sDrH6UKnBBBZO+1eJA9lwFSmmgp7nddToZvSJL3qtk\r\ncoqUwEH9QwNWtiFJvjdPFj8kBlXJKog/44xA0nOPd4QpdtTofvwsfLm2pn92\r\nJB0Di3JROY5ZLJepe9Eq2sklTW06VIi0aNdfyXUGqRi9LTcqJrNa8jRRhOL4\r\nWu8XCe/pc1EwAOjDhWbrrML/9BaQrUrUS7fk+QNsAnKkQhBhx7eSmRLOhNYb\r\n12e98djgtXqEnXRxaJ5lycJji6g6YzXloSu6f+TkCH4vxW6XgIKdfberlncD\r\nXEC3v2zh/RSUX/rJ/kawwbq/Cj+We/UaXofFJSBY/4aDQKiZPE9HxFtDbhVW\r\nXs+PkX25qEKHVDaBm/LQvrC0IZ3PNkBFCfNcVyLtXOKiqX17rH7oAsfCpYti\r\nvHC/4R1YOxmRajLypsBKLRmN/neTWLOnNdM1zQI0WakuUMeLa4h7ABDqAzUd\r\nAT/H+u8Z0jzxWN+FHLaUcTP1gle6djp9JVs6Rtr9WKRZ7HhhcDlCIoR1JMHC\r\n/LBKOPB4SMv3+Mf8FndnglaitFfgEKuFLHY=\r\n=H7LV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f8504701ef573abb3ddeb6cf4e9ff9013ef98501","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.26-beta.4273"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.26-beta.4273_1654326817964_0.6814169295614398","host":"s3://npm-registry-packages"}},"0.14.26-beta.4274":{"name":"piral-pwa","version":"0.14.26-beta.4274","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.26-beta.4274","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5c894988c06bfd5d3703bd1c2244832e8cf85ae5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.26-beta.4274.tgz","fileCount":40,"integrity":"sha512-USouo8AzUD41rHYELQT1n1mBxxQdTDmtTtIUYKywKzEHxPEUdVh1deiIOoclddxcPlu6fzLUN59uPU2eI3dszA==","signatures":[{"sig":"MEUCIQDi7zGfsT42gLRZXP0fkHe8LFU9trsUrI3otpzZtlEe/wIgdH4N7gQMz6G9WgF9qmTGt7U2DT6aLNAJTSLfsGWM9zI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimxE9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+jg/9ECzBN5V/UCSwss5PCZwdu/d1hEPEcT7WFELBSTzIwL1sAGtj\r\nWby5B1Km/7BTHzV1yjnOzVWDIicwUpHDBEEFzNkp60T52BQURfU7bfnyKCbs\r\nI60fjzGEgYLIm6sHKMV5ZTSRjgeDbE2njxzknHcES0SFSRdqygp5xrVMJ683\r\nVWQ4qnF8GhCsHLsjeP/0z7yhbkl17gfARn5WE/oAosAd4QDnS7CbuS4BxfnI\r\nHQQ3UbXc5L7ahooiayiQQFnfe+grrMTeu8JOfr2tVxZCy0cyAMuuUWBG598G\r\n0Re0Gh5vZiQxGXbnLgPVf2jb/hzbmuZlDanT7zA62Pz1CSq+AwiD0xO5ljAw\r\nxy8MArFF+noKwWeBuWinFC6uHki4I9qkOXANxsdhP80qfzW/hj8K5MCI1UKR\r\nkqF3qWkqn3+I4JE5rZ+MkdWcQWYrwUheo1UwriSskrSES3GApGQ+4McSLMBl\r\nHyA6zVf1HAnxnIWTHnsvFqN/S+yTQ6l9GzAgp685ud8W75m8/br95jM+WFJ8\r\nfkeqceSnooAaI9sUk+bJdGIWcG5HpcjQHaQUzNiJV5pWbBkARyK8akaU+3eb\r\n+zo5Ja1BMMfiZ0hI3sqry6TjIEyIjBEyHaCkejiHnoaVRwZTCY7wczD34gLK\r\nZQQbcutxtuwwKx5A9Fpn4Dp8tJ0HXGgFyXs=\r\n=qqDs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"fb1672c17322edc438c614d6ea277843f3b98433","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.26-beta.4274"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.26-beta.4274_1654329660962_0.3244379393201342","host":"s3://npm-registry-packages"}},"0.14.26":{"name":"piral-pwa","version":"0.14.26","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.26","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"418fff1643be0e67985b8a01555b0d8ad5cc68af","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.26.tgz","fileCount":40,"integrity":"sha512-br9krb8S3xGStNSP62pJjyJlxVs6A2KEj3kR2AyilVUpyeRyrBBEobnieBch9t511iRLclEo5YILJxrxec47yQ==","signatures":[{"sig":"MEUCIC4ljbHccIPpnW+XY2kXZxhz8Uzy7plEtAf2reTIrQhuAiEAzEQoRUXNrnGJaq53xpPp9zM31588UKDySslc5MSXrss=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinLvKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrn4Q/9Fo2v/mXvJHhxwlrEACTEAt0UV5Suc7Fhp2ty1Bp9xlCqFCkP\r\nNZVTywedV4jHkWxtsK5BNVwcxBjFhWiLw1Sqo91qdF++YlA+IgPdusFKj+vR\r\nba4aBZHRH/kcPtUyZ4cYcTbR67tywYL3TzOyf9wUKYKyPpPQRFLOnqUrbsne\r\n/YxHevHmWcbPMghRRIwddnsAmyr6h7qCRcc7hks4Qyo+RsC+4JE4wdqzYIKi\r\nI92fh/g73UXnPtmsTp3n93mdZrk7z0ekHvTxScNUlG7aXPpqd/1lu6CTYo8O\r\nYV9drHABYYELXtgMl4bTg1cAAaNc+DikwOWKsRbQf9elgDT+cRJCSZ1vLUbi\r\nitwDasNVd2DUILEEQfEKcO4PIQDP8Wt0EfAahm3dhJ9z/EoDEjoXTSM5Pr6G\r\ngRZZfUN8CWfNopVYIgsl455GqdyQMDdEaQVxzIMFuqXRfFD/FWfbASAzlps/\r\nY43pgtGEBNAIOexBCDWgMOhQMkQ6zSLCJwkF91bSS6E6VXfu/rCDm/bdvqNS\r\nlxH2/aEqIaKwUZT1GG9b0Mw4Bo/CYabTW7Z7RQcHitF4VODs8sLVjoiEN+ps\r\nalu57DHszo9jXiFee+1b7QgrukyA4vckWHZ1Hx13Tba3MQn6Og66Cx3+qQM9\r\ntIUPrnxtrKIQfCCS4NrjU0+bNW4UyAAwmGY=\r\n=j2Kk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"8de8644cd7d8af46c85188c31459e1bd171f7ae0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.26"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.26_1654438857915_0.2098341511921229","host":"s3://npm-registry-packages"}},"0.14.27-beta.4280":{"name":"piral-pwa","version":"0.14.27-beta.4280","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.27-beta.4280","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6118e8ea4e7e2975fba5684840954c57fc3a838b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.27-beta.4280.tgz","fileCount":40,"integrity":"sha512-ax+X8bW2c5HVIxcl30f9g2oc97RLDAjcPXpv/BAVXI5EQ8wK5c/7MEZaptCDNQGBLVjVESzG2E195d0wZTcVRQ==","signatures":[{"sig":"MEYCIQCcbeUUMo3Q7cbz/m3qcp99pcf2Vh7FIxmlHL6rookDiAIhAL67hp+Q0KnB4TdmNlB9ZLqOVC2juDcA+n5vPZ6xegFK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinT9qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1iQ/9GZsgnYjCZFREuXMvFOGyuyKTOSET5aGoZi9WJkEGg2FC1GPX\r\nE8qgPDqsfqkXcNplXXNp2evILra+MUjYhu9j4XLeMLODk0Ij25GRC1ATa5dZ\r\nda9o82YQwQWP64iPXQFyjGbZ76GXCx3em1OIqMCye69erxh13LBx3xCKKSEV\r\nEmkC/DIkSFbGRsN3ht6ouUzj1jqbri2OTP7MWxU04pt/R5N5x9sNHK8PP4ja\r\nLPJV79OE+W2vfndiOB4ieti6yfDcfkQDtO9mt0hjfnwdOGWcwb2K23AoWS0y\r\noswjt5l13bPeEjSpI36I85ZpERAxmiK0gMbbCCcRISaQmFtwIpX632Tm8pcT\r\nHYnHut1LtflNzvBFDekWKatsetMfNR7/BhJWIv74ChY+v2nhmSbSnvNzzfMd\r\n0pjClYspyDTMHxlBkHyy02ocR00bWb5/uUAmtlhzCxOaf2bQsalHpP6LMIek\r\nlAYffKA2jwEd/e8iR0KHoj7dm/u4xBVnzXHpLElejtglWq3SCVZZ2D4YwfaE\r\ncHoPMjAE2pGRA0/L+kiYlL2GQQ11zPBtevLHIfLbsCPoNWhgWhc2OrGcrXr1\r\nrBMAHSUnX72r/ts//ZKpzxjK+sE9cSUS5Tze6I3vAzwOFyrxP45R8cm2n0BS\r\nqVn4EYSOSOYFghgles2VuVt42OBTUw0jhzU=\r\n=jskk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"eca73d221819f50225ca335cb8913c529f252e33","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.27-beta.4280"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.27-beta.4280_1654472553867_0.7661868175479312","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4284":{"name":"piral-pwa","version":"0.15.0-alpha.4284","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4284","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7168dc5711a55c55029bec63e6c081f28c70e6fd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4284.tgz","fileCount":40,"integrity":"sha512-JnmgqkKqWSbJogJF9zqWYthSGTegzdzpRJ+RP8XsVZw280tjSe4/9LglkelN/LxqNemHHc+0rWHRISgxTb9HWg==","signatures":[{"sig":"MEQCIFnDzRASQn1Bn9CmlBC8JOlzxc8gN88zelqnkEipSQxkAiA6mXKuN6rpsHH4Su9dxgN3oRf+kuAKd7u8c0HqmX/1Ow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinc5eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSuw//e27P2HiXEW0bglrflHV7APStxHUbOYfq6LWeAD0Fmmv7nQca\r\naDApWphtiRSdbY1k7WXKuivrjiO0j86BUijo91MyxtqtnPsHt9cJsytonuEi\r\neNSBxuVg5k4JmbLcv8I1+KqueNzwa4OALiuNZ5KUJ/HTMhngcn/hdTdeSqYM\r\n60RyS4rYo6e9Thqq4teODVt4Gw9/ruQTe7tLZ6uFWIweaZKmXAJVWGa8kKDM\r\nl5ynUQsEzAB8XRlXe1RhU3uIX1LxDeYDpX9zuIriW8vtO2JWzQJyhmstUSci\r\nBCXT2DiDIvYmcbcFqh4juwztyM6Kw/27STDEtXMtC4zn8ukJn4mygDmjKJGz\r\ntaIJA/x4RClII5XSh284x3me5bTKH6ZWx1nAgt+DONdt8HOXIU4QbJdI7ZX7\r\n4nhfJEDcxVxz00MeHffJ9HNSuqDaCdUxZmn3bqT7QEVKoiWBeTSN+jAGT/RK\r\n+yXstHTDamZw1S2FDeElAza2lxGOL+u2EndEFWk+EPbeJfGAacZK/89rBNJW\r\n+TIuebK8xDra2xW1kqCVd/Ba30VFUOIMqkmSrUqZWbjK/A3UkekIguYfwafl\r\nIJ80Ndpx7ciXHps3vUgXI24Z8C7VcmJcwkY5uOR6fI4apKVrETLJadYOI8mh\r\n7YXrk88ftPOoabY2MEuSyFX+lWRwunDovVg=\r\n=OFuz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"c48d6a2c320241d04e3c9c4c4edb423345003587","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4284"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4284_1654509150725_0.2827766841439274","host":"s3://npm-registry-packages"}},"0.14.27-beta.4285":{"name":"piral-pwa","version":"0.14.27-beta.4285","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.27-beta.4285","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"82079c26b3f19d5e8ea0fe3a014035f4c4f460bc","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.27-beta.4285.tgz","fileCount":40,"integrity":"sha512-eR7pVInH5M7fMt8gJ6sYprj3N4PhLErsfJfwOofY8Z4kmKzSw7QaZfO2WC14oy07VacdfM2c15UodGDy1HZDfQ==","signatures":[{"sig":"MEUCIAkbNMjuwGQQACev1ENvrxYlc1W/4VZkebMo/AaUOKBdAiEAhPvhbgzHF71uRK2FNryVp2kmkjqGsQPvELD+BwJmR1A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJine3qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpaDxAAhHLD/BmQQ13fWOXUUf3PqC2VkjHIj78Q4QCTmjGT5GBcZjhT\r\nilCiBgCtM502cvXr/z9xqAEer6SRwQjlsX23T7tyGxBJ1IVZuNSIXYTx8Dmk\r\nnJIFZ+Ex4sBqhdmhsNaUmnNrYWMQont/5KUl5m9N4ZiJLhQnPiPR/cNcRs2T\r\nW9EUB1jM9oBJcaTtP31n+GMVXkuwaKdB7k0YOv2AR3MIkeMZ74I97kF3XvNZ\r\nOqdw9ilBYHKqvOFAxI84hojNll6TD7sqsyexkXQF8YIHAhi/SDRKUpg+wDwh\r\n6LXgUrEno9SrocBsqxe3c2W1kNLDcsVKP7OdjoFK/g7FdbNAnnwei1ZfsufD\r\n79YeLalYlFY9dTWjdDKx93Gcbu7NGQPtmPNebICh8dDnWU/JKi8/RV2zaC8J\r\n+l1vO88NaEB1haZ+PEm31iOutFtMpn1FZxRdeVvgLmZOaUIdkJh06uwEHYdp\r\neB7gpsE9GMQ+cjGx/sZyiFPttONr1aXhz1GW/c6zi6jhhJONxJ2LvjTlJRYv\r\n7zgOVXUZXBOVZzKc0ThTdCh86miVTcVLV/xBAm8fkKv9S320fwzNZ5IyWFGo\r\n8Q33mP0CAL43G9xnrXP29kWJ2viave6FTzUrezj5awFMdUOWD7Tsm0iuQ7vK\r\nVNiqvTH6mzsBh4mlXyg4R89Oi8t0dn87+zM=\r\n=mBXj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"a727acee9d9793ac10e7db71999059cf7c31a88a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.27-beta.4285"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.27-beta.4285_1654517226270_0.9650903440686665","host":"s3://npm-registry-packages"}},"0.14.27-beta.4290":{"name":"piral-pwa","version":"0.14.27-beta.4290","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.27-beta.4290","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c753dd09b16f326693f0250e435f96e8f53da395","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.27-beta.4290.tgz","fileCount":40,"integrity":"sha512-XYO5XJaPwd6vGQWNswPd/X/vsu4Gk2JQEvE2JMhiwQzbHFH3eKMm70bhvcZMJBrfWZVspeTYSlZatVDyhHVKjQ==","signatures":[{"sig":"MEQCIAmxgglMg8WePOmr/dqNCNpTK5z50SJ56sBVntKtDtZiAiByj5k+Y1UMFRGyUNOw/uwf8kzgXFlHqFB26IDoRHy+8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinn3OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRJg//cYhVGKBKEbuU3Sh2ZOOBcDG4AtStn0BbHd/GxRbFdSaHNRga\r\nAThazY82iQ60eqz5rrEbd8Gnv36JQo5SNHo0nwMnt5yFStT4zPaHfVf5Jloy\r\nq7GW7hu2Niq234Yj+BdvOa0xuCBOjwY+IcNTGyIpqar8EHLJMkXgqOYL45hi\r\nulwF9p8D/RSAo2rcuL7mL0A1oZfX8Cf45SLLFxYn7Jv44qOmpZTuN54qsN/G\r\nzhfCKzqT5y5WYWmu05ARzhb1G8HzXnKwPwduGdXoTf+lx547FsCBy5kJ3Z4j\r\nG3rke2DSCw/sPg68wo9a/ZbHH5PUNJtcOmSUmk5L+VG8ASdrHIAaTQjnDiYs\r\ntlPFd6Dqt/y5jSS190EwyhWjbYfSn93bXhmxXLujbtqDnSGQyvLKN+C8ITta\r\nL26DP2NJqZnpmQuiUJ73QlbNpRvzwdSzRjnTf+zNWYFLwD98xLVJnqT2SHio\r\nfqv69Po4H9uktE/UjajlnW3Y2Zo1TGCEwvH/VDRm3Uezl6WiLT9qeon1MSxq\r\n8HewfktlzPv1C0GlGYAWnQ/6SjkbiJhWFfwZQ3JJp8dIUc1DQ4hnF8sIcfS1\r\njc8KuoBhzPSUkPkeF0AhW4CW/aLftcmIIrHcs1YW5fPbEeKiurzEal05S2si\r\n/GqAo9cwk0yfN8MUhubqobVSQ7YTWtO1CEA=\r\n=Bz5s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"82fec640a46c17aa9ae03dcf2c8ac3895bbabfcb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.27-beta.4290"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.27-beta.4290_1654554061796_0.7422398724097115","host":"s3://npm-registry-packages"}},"0.14.27":{"name":"piral-pwa","version":"0.14.27","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.27","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"835aded53ff5c6f0d25df41f40c75edaa5a9a2be","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.27.tgz","fileCount":40,"integrity":"sha512-24LoDGkMjDFtUTKFGS8Yvb9AAaH1SLpazNUIomy6F6qSSaFc8PC+Xe4pFe28BqJIEggi3MmTulVMkEdKo5RHiA==","signatures":[{"sig":"MEQCIALBvfoGOV5QD7Vo0THAT+LVLmhxYjsk2Sdd7zOZaWtFAiBzEaPMv4mO9EL3zDoPNuTgeImmcoTzyG0ZW6sS2XmtDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinpmaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnTQ//TSD0rZ0icP0PAhXfEsRPKaOq0VqvmPwjjFCPUUnk6YVUAyr1\r\nV9SyeBGDhwykSMpwLMlILAl//LPFoqcvII/fDcxF+Gx1RHqII79eOjkHuX9b\r\niFiSj8qXo0NrW2F2Yopym1NDf4SCsf8KbysKmtPnHD/JoKvpau19gPJ8//oQ\r\n95GrmzvkWcghRrkDosRIckRyJ5XX+uwQeuJlRfCE32J7qc8XYCPBRSdvq61A\r\nzDYnftbzxJGQseo/71dAQxFaACsE3pdeIlwLnmwMiSrB0Vw9RE1PAoDwdrTl\r\nAESTJCnSxwPoXw0w/HIpqt5LqPyLq3MDB6s6o1Kf5XXhTmoXjyRazGRyXnEi\r\n2NerjCkgCFDRx4IqB0pPJOiON0cWQBvUEc76Zy9GdoBv3qfVlQiCZgZ8sLQ5\r\ntHPn90QAC07iC3WCPJVlDDDClc5u7ZovHZ5a51HCzj+nKdiUHfM/aTnK7hGa\r\nd0elzbz16d18PQ/Li+8N5wwfBUIsJ/YpCYTtN2aWMK/0Kn05kxrppZc8p5vS\r\nCpdZaSEl9Wk//7CDqKztXYl3E6sQhzEuRP+2k3dho6zQ+nd+uIQNgpaN0TFd\r\nB1RimccQZXR9OejYV5sLxgG3IDvVzXcV4uOP6oEQbGLi0MRRnMazUXRnpfQh\r\nu+PTlrAc28mhSO1aAfuADE9iD3MLxPyJTpE=\r\n=stLD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"fc4bee782e8cef7d071fc9b0209e485b6f30941d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.27"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.27_1654561178764_0.02588651094210981","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4311":{"name":"piral-pwa","version":"0.15.0-alpha.4311","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4311","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cf8a8bdf00410f7e43edd3f0f39a16b0b4a60db4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4311.tgz","fileCount":40,"integrity":"sha512-IptGae4jM4ddGzo6asSkOcpgjNWxWd2/U32JVpgDUhFDTC8CLBXqKoBPccQ4VVjb8ZUPKkD24ipXkySjOeeJWw==","signatures":[{"sig":"MEQCIBPpUUBpAlis5clkeaBokUlLnwW1KrygoTpK59RU1IrsAiA0vyHkI6Dg07CNFdEvuAxymOaqFN+XVAGaVZ7sw2zJ4g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJioKcPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjSg//TJm912hmjZFzRuiSXdv+1CYrfVjiK17Lyi0V07vawF4NQaau\r\nwrfJalRJ6r2oPBO5MPqlzVG4/SfF9ys+Ue1IUs3RDROTiYIWX2j7OetfJTcS\r\nP3w0J0TZOGvS0iVMmcWfGDeZvv3ZEnf/z69B46J2PTQOzetXrcQ9eB+NKT1h\r\nqY7N3XWmWPzCnqY5l0ZBZUMDfGgxx02brJm8mJlNASyRlXnWFyw6e1vzZlrb\r\nJjBbotuGb9r0lSzYqn9A7HBGR+kQaeruPy8aFGWK+N64veau36JucgX8df9g\r\nkPkfa6F87161fTlSw4MzZAUKlsJxZZpLZsBGvDck1laDQAu/9OXJ6Acynok0\r\nX1TuT0fc2V5JbL/yKJSvzmW2cJ47ZwICGv8HsEYHAlKMVEEh6I0kFN5DMYAk\r\nuuKQu0T0cyU/nXo1dB2jpCORLaF/seeHzg15NG9nwQ7oqTLU+tvskGR8ciLP\r\nbG008KTPleQDq+ZC/0O5p/DzKBx0mfglJTUDb7wgyYQIr4f5iZUX2NCFSM+I\r\nFZyDa1LcrL6Vxa/6azNK6XAseYfdz9KslZPokn00Of/C9yXljDWhQx7yfFMH\r\nw+7R6mr5sN+ytuFNG994m4a/zQl7JOEZlKIXP5bcpLlcPZhNp6SMENGjiJoz\r\nBKhWtNobPsY195w5apvL2UA/ZoyQNZXrfVE=\r\n=WTtS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"394262be7ca4f7883adf6d34d5635445fd1ef9b8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4311"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4311_1654695695235_0.4673633125888492","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4314":{"name":"piral-pwa","version":"0.15.0-alpha.4314","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4314","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7d30f5486f44b6f8f8d0940f5eb3213b0db9dab1","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4314.tgz","fileCount":40,"integrity":"sha512-jsTMLmyiKDZLP4IX2A4R2yGahI9moA9oQ4P/R1eyIGZZ2irWe1QJ9qYILYWqLUJEiEfWduMpNy52bQdrEA8Bfw==","signatures":[{"sig":"MEYCIQDsSzEoTdLKcstyy33vS8PWbH9yuZlmg43WtJZsZSv6EAIhAPvGYrO+3HpexkzSfto0z5dGTG+76jMxLmyrozN6eMtZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiogsQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxXhAAkIjwV5HhW418Twiv48Q1Hoa2C9+PGl5+iX+333qIfR1VeDxt\r\nB833CR2e1Gzy8bfKqoJEPJgCkEXqaub6LMXApLBxjjnYW9+Fyx9D841SuOpr\r\n8+dSTdmAPHkEwQnMNoa4DPbNNdtDdtN8nWAXZ/M9j0ahmBiATczEM8xu7QQN\r\nQuB+jVXKlgvrkM4KpBzZzWxGyL1O01FajuokxNGz3GBkBMMpz3H8BM22+Zj/\r\nIyMrRHe+ra9bUhmpJbSrrpcY40mJjVzy1KfT6WU0sL/tiMtEtVW5HI401INl\r\ngC5Q3sRosstXQ2GfjGns/nZ7wkDwyFpK1sIzQ5uMXfeprr9X07PjdjcyuiSQ\r\nSeGClGxHFoUZ+dg7HVEYT+83KzFy1bL5YPgiIAs6ywMFTE6XZOCoF0ySbeHa\r\nFTa2lm42AGU9vBT1V38spBxdO1F1a2cxiobwC+jD8BbEz+uNIsAiHwEngFZj\r\nBBY+sI/atCAuEm9XX3t/eNLXsgG0cV6nLXMStkzqZVdKjOQkM7pUUsbv6H6c\r\nrER3AiIeE56c9STnBT/oJ/8S1KfwIov4m7LjcrZoXWJM2Y6ycBQYnW5GPbml\r\nb6PVha7rukmFuwTEhZvPGeebXTVTQ6M7U16zr9qiqpER+zFZv6XpT1M5ReFG\r\nnj1DSfa7rPFsvThpmKpDpfvzG5CGIDn9JAA=\r\n=+rOO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"8bd59debe22a0fed137458a5295eb2ea43d9e0d3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4314"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4314_1654786832453_0.49251562576154373","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4332":{"name":"piral-pwa","version":"0.15.0-alpha.4332","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4332","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3a65c7c1aa071be621b4740bc62be133b7030c81","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4332.tgz","fileCount":40,"integrity":"sha512-Nn9MBo4wk3KCiHPQlIK0yjUTVXMatqEkbLrKxSPTJ5EcT2OkwNwFzcvZyQtCjS/w9SvqMGW7x/GrdwCC4K+QUw==","signatures":[{"sig":"MEUCIGwpUn3o9zSwW00iH1cJaH3BoEBavpKJhQOWs74nlGE1AiEApjWJniXpiOsYodGrbtEldkG8zjahbBNEA09OZGxPp5U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqGHTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhzhAAnNwuzXVLtsxEQgLtaYXfTgiDmNwSFffyBLhRDAwrRXvl3nh5\r\nwTFJjEVcIPb7iDHcOelGJGEV6IAP4g88dZAGuXKb/NC0gK4SD+Rs8pT967dG\r\nMXaBoAvn9mIyvXYCS18tYwbG1or5OIUjPBRf7FmTBNqhjbdVdp4jXmsDvxyx\r\nVH7Q3vNSD/HaO1duVrQAmbczEu32p12Oy+PY7KTISQfZL7Sb+bF8XUxSSFTl\r\npU2bIyBRzcyFbhu81QRKs2dJC4jhMPYIt8wM/0RXjELEO0WKJFCuZje9X518\r\ny6mSVv7osCnmR7xhD30x3ATa8emNWxXPN3xVQGLy2uMre3YHIujii8d3qvMP\r\n//fXCZfajFiJ9+0NLDeZXLf1M86cnoq1izcdwO2ayIVOsdXKnBjk1RTA+T60\r\n/1qKiFkA2/K/i0OXoc85wn9zwn20OLvuYFHHXIwvUSyXXrISdfr3QjrguSEL\r\nE48Ecq5GrzQ9XOypo2xCf6ibe2LfjoKh047Q46D2M5STUkAchc4k0x383MBw\r\nyXJRzIazcSMgUgGQCDjB5TwqzWIVdTjojz+y9XqI+F8SBcHNZMicH0w7+MkB\r\nsTq/DE31jkHW5Qay/KcPFoYX8xVLxiMBCLWHYMut2vBHTq2trdmIJIsi1br4\r\n/8yp2MLS1N3XlSpEP0DChb8xX9vbeaajcIA=\r\n=SdPo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"109cacf66ffee5af60faf7bc861e5ffe8c9a7cd2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4332"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4332_1655202259082_0.13518791945362274","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4345":{"name":"piral-pwa","version":"0.15.0-alpha.4345","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4345","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f962cad3922a002eadb2a81448b15cd09781458e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4345.tgz","fileCount":40,"integrity":"sha512-v6dyDp7ZR+ex6cya7ZUF9GiZOwP5BYOQ1KH1IKfLVZZV4TOa+Z7z4uuGRV7nzS1M0rk/vOw0t+n/2WdA/GUlCw==","signatures":[{"sig":"MEUCIQCCEHDTj/j3g1MEG/O5l2XrYxOLwi8SNIACPXaKIQRe5AIgW0h24ueGAPw0zSSmquK4Oc6u6romTVPfQQjvniKtiZA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisQFjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNBA/9EOgb89cWCTO5hUy5NsV/NVGsBuj5NJwumIgCv9C1Kl4nMyB1\r\n3f/mUOhW+FSXrwMUpgDBS9BIrY/IZd/CHbJofJh7EssRtpysq4wVlIE6XGVJ\r\nS0jixXY1JAkHStFysJCG3TnkS6kv4NKuoSm2q4veQ2tQ7lXHL9MceG7rz7d3\r\nUFV35S1KLhTFXB65+cZDAFjRta5z1lh/1stOa2DTs3g+0YldAO05S9Zog68H\r\ncR2wSrLNxXDaOxvGFG674uhbuebePVhDQwyM2kLrAe2g0Igr+vp4hbA6P/Jd\r\npr2lkUlVgqNhrvdbyf4rhoRkqbkxjpTADALVQ/r2CfNJgkSjj6287ydq9ws9\r\ngDiX8Y71xzOQ38j6o9mJJyE669UXVClAcCl09c/meEHaHHDds0WYd8QqJx3s\r\nui714DAHvAxVRoyQIx3nOdSMQM/osvxJOXMP5LB0AJ4dpLbO64wyhkRY8NS4\r\nGqlgcyLQW86rtBHFUEy2kvUYV+68RzvN7yk+/eeinoyqiNgzBnADug741TDl\r\nwL1hdBKTJGKGEFZ2ES0A3BKNK2t3T+xKACJ9YMKXGlYcVHkndRDYCL+FQH0e\r\n1c95nA2JkVyidCSpX06FVw3bc+z7xaKZH24jouTAuTlWbXYt7L00xhzxoguM\r\ne2+yzWEABijHJ7RkDEuYgCZVTWaVn3ufW+k=\r\n=PyiA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"56ecd6ad080b3d275752b19afcf8435e4bd09140","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4345"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4345_1655767395771_0.2945559600332468","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4355":{"name":"piral-pwa","version":"0.15.0-alpha.4355","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4355","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"76ec4a9bed5e28b0f26d035474df4d6571028aed","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4355.tgz","fileCount":40,"integrity":"sha512-gTgIXd2/OP0egMMc3sfhT9kXCxvUnhGYEQdlQgDkBPjLRy7W3J1Yknz/whPdsbJUyyYOsb2p6GQVPSWyFF2htg==","signatures":[{"sig":"MEQCIF/rhPhdpcLYfA5nltoFU74RCQHD2gaE6ssQ8sK0WcsWAiB+/ij0tlNW88v/9rlEO6/9Vdkmuqo7Oa6v6o93/JAfqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitaLpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTzRAAi+AZeaZl4vAi0b2oJxoPB+LaiZ5OP+UIuh6XlSbkcZbX87qh\r\n7lnnA1jhEby4pNmonH7Zi5MWPyiBxQlF7KoRaSznfze93QXirmazQQ1qcmAX\r\nDvHv/70EoJ79y2d3UY/m+CI0npEwGIiIrEYthcsRMmjNU3HLsukD5CaxaeWM\r\nzcGxPrun+1XkyKTYqgbAAOLU/b4AcwxqAqyi7bKtsgu4hDHjudL4ipaxM+fP\r\n1AULwedqVb1m09hO+BD47Tn0wJLfbVUbDCKBzat0Mo06rPJerooYxglroz9O\r\nvbYj1yzavXQaMQHd6ey3EgeAGyK2B70QQANBeOJSGVihocN6JR7GP881LEA/\r\n/ovqmjy5jUI6P+yrgr10+ajbiv6AVN5TTQVeothCkbSHYOfsHH/tVp6dEdFr\r\nxji1M1SH4kHv8mgoeYbNetoOmWbYBfL5Ny0ohb3Cq5pWsQ5nMNAbYW5j6gSS\r\nzmo9P42MtHrrQDGyqzI/IrFaxxKEjL7u/b373o7MMgEUqN2pFiTfg+6v3ZqL\r\nP8nKyYPB+Uv0BzYrN+W7QcH832+S10uMgtcMjzgoUd2jqrvJsXj6oYYGtK3/\r\nWjWlOZWaDW71oaAnc/MFiKF3jQmQ2oqTqRN3AtGivqS4IrGGmb3xXE+p30WU\r\nxwWVZM9Kr9xoKHhrBvLrw45ee8GI4qd6kSo=\r\n=/jFj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"a4dda359fe03992cd06bfb808df916747beb065d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4355"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4355_1656070889426_0.34913215234327555","host":"s3://npm-registry-packages"}},"0.14.28-beta.4360":{"name":"piral-pwa","version":"0.14.28-beta.4360","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.28-beta.4360","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d048fd3ff16502d72e5cf191fcc9caba1bfc75a9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.28-beta.4360.tgz","fileCount":40,"integrity":"sha512-bc2kFpAbxhRRzSuOcw6Umpfb8e5k8b4fEOyNCdokuN895H0T1feIbu3YjDSCJ5grACS5xT/a/mGl0z0wjcQ+LA==","signatures":[{"sig":"MEUCIDRgzUdR6Iyu11D74ffsQTYi6bn8Cfhii4YLeff8epCdAiEAorF9gb15c+scSLqnOPFgrUHy0QXFHGtR5DzEcMbtpRk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuaOIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyJQ//bJMbKaT9/pfsuKtAEQWGnrkVcz5dJUQuQkt2wkuEXMkuw4Fc\r\ndlJuxMVlo+6FN6SwyyKJwaC0QviIzcFK/TXqRadt06101FszqMR2qdtVbYnt\r\ndM88dDo9EzIFHh1jQ5fjYwa1sHAUP7X+a5PlldPDJxTVoAznz1Kt89YhWkNZ\r\nyG6xJw/uTozLdO7Pb6z/Wf/tvjcfu1X+qPR3KJ8P+76qj1KryaUvfxGJq5w9\r\nByULvvRIDRS/UcmDOlEZjp23HbYbFlsjFhaIlO/PX3QaY2pdCbO2DPEwRmzW\r\nHDkNxes7/gQ6DJ43Auj+N2cLs55zVxO834wEOTYs/U3idagvf8ejlgzoG6wl\r\nqK2vQ+xinhH11sftRDRDtRp859LXOmIs4BzfbH+LS6WcIiQvy82ok0DnhvtB\r\noslajN5XB/eY8flt9i7FLqb8z+34H9XrBMS36KFQ290cdUHShTQxG5lyN3xs\r\n6ek0nrBNZsOgDX19cqVSGjmhbphSBPorPZ0Za33HbHFFNO+pC7ZES7ySwesY\r\n+f3eKRufJvwZPs/9152JhsMSFHA9M4QgK0IPW0TWcWoHg/cr3kV3J82iDHIy\r\ntzQmVzLYBRhg74zGTjcGXKQd9kj9MGpt4AQmeLMBgW/BilsYQu7o56wzzSqK\r\nM8rXga321A/WXTL1LG6Pseb2ok7eIKWCxFQ=\r\n=QCTX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"d7d2a311e7c9c2707d46f41a78d435ff44bc7169","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.28-beta.4360"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.28-beta.4360_1656333192487_0.12892185322301386","host":"s3://npm-registry-packages"}},"0.14.28-beta.4363":{"name":"piral-pwa","version":"0.14.28-beta.4363","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.28-beta.4363","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"85d1558d14092097b44f55d95ffd1016f9a104a0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.28-beta.4363.tgz","fileCount":40,"integrity":"sha512-L5r5IJ67v7mSc+bIdAI/1K224O2ga63H4IOP8PurwKpqeiwT5KHUoc2mOEDbACFCU5TjzTR9Y5qhl5AuVBFnIA==","signatures":[{"sig":"MEUCIEm7lFK2j/Huh0WT/jrFh0TCudhtzCTLa1fEKoz5W2oYAiEAnevsNovuFaRJDaL1HMY6SG8om5DLE/u60EukVu/LswI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuswkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpR3RAAhUHjz1rUyxx+GR5GUMm0tykVsevHq7KrwIj0nmnerEDT37yK\r\nLvcErB8/yqaLjBWgenRDdNKcCUntEdVNc04IOG4jh1XYiq6P2B7iq4/Dn4nA\r\nh0VgFKBfb/8SkaAltKaTt82OMvZdYds4EX5liK/RINzNasMw/LmFjOVpnQbj\r\n+fuLQgJZvWeJznpNvl/TGLpF4MLud05pK6O42MkJPbIEby61C3iorAzXk9bS\r\n2YXiezOPjEX6OLeTWyq7NVz6EJs6BtIotnXibDNxlaceYH+vJgzOtrGRnzmI\r\ngq19P2XMc+LSEmO9PVLV9+q0oKkXIQ1FWlclDMk2jnqPMRHagl9FXDrCI/G4\r\njH5Q7cPyrMKlVZQPwrU4716N1KjVThHloQRl3fXrXSDVzGxnKAAf2ewMHAmk\r\nX+GVcLc8fln+8KjqprLvxI5lfIapciPkaAV+JHmJBqQybWC8i57BvzoUNd2C\r\nyHJ5tRxu83TkvxGxm51fd34GrbxApc2vC5FweThmf656fcgRYiUQQf7eBTEA\r\nUlZgwreChgd3FeX2Mda0xcnpom5zaufSVW6LM2uU4Iipl6pWEu1+22P+6jsf\r\n6Sk2WgvVHpQO8UQlLxTPCsIsTdcHhUnrPF4BNP0aiRQb8R+15QvedxtzHPlX\r\nzp3ldoz9rpEvd8lOHrZvrFagBEuBdu+lp/g=\r\n=1pPa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"d9425ff60676c2a1ae73f1d5c13527c58242badd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.28-beta.4363"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.28-beta.4363_1656409124003_0.4977146731093529","host":"s3://npm-registry-packages"}},"0.14.28-beta.4379":{"name":"piral-pwa","version":"0.14.28-beta.4379","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.28-beta.4379","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d0389a1f3a41556544dd44b5f23d1bec03655609","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.28-beta.4379.tgz","fileCount":40,"integrity":"sha512-hjM0XIsRPUDVVARaVKHIUbjh14yDR6kaSasijzv548O9pL1Vs1n5xp/a1+6c60OG3Xp5GUA/FaMgZ0Lgt0YkYQ==","signatures":[{"sig":"MEYCIQChupKt6D0cMYuAcP3x8g8eIjY2VqFChCwUvf/DKEQvKgIhAKmeR8BdYbkx6zRQcdPEwAyACDE8pXrOd5TUOUXgrXrs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivp1+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppoQ//VTYLVvaTTFkUXMlhIYNxjQKzd18M8b5BdDWHJx1ImxN7xFrz\r\nAzE1X5j5Jpqh0/ELVwWU4bTYTrsvrGVM82Hskr6GElSFLYz7nmFmpAHnEFMX\r\nUcqq9zq7kC0sIGhoeVrKrgD2VWP/i3nfYRNO1ahijDelGVH80Eo7t9/YTI6v\r\n+LYvgsoXnuFLMv57uZCqlYVF/6/9UtlE4UxihRjO0X4+KVz4WdgoM/MxpqSs\r\n0Z6PWK1G+GhxvhJk45S9dZnotzn+PnKX/rIxMTmV1h6d1FF25rXjOKgPn1wg\r\n6HRpa6YPXX2ELPltDoGS5u/bHhQ0H8ksLRJL+sa1RtXcQPs8r7V9MGd5TYM2\r\n32ubXP6xWr1+bW/xS1v4dYu9iVs3uKOvebTdnnPMXliFLc0RhU5N2NWR/tB8\r\nY/pJ+P2+FnN/5qeIHHDEPs1a2/y8+jVtD4dOgqyFsG3WUfAoIL+XwdIEpK5t\r\nZADk8T8MSHp0EI5UUX6dQ6J8k6zW+pzDJcR+G1Rj5adBvJdgdS5haIn18AEp\r\nC37Vxi1AF3u5jmiCAgxaPhjHm+g31ODusFWlCjSTHbbophu+EpUsBvaH6MWM\r\nAtd3eBcWyLzu3LDD8bGXY21Q5Wy/993jUcLZ9vO26wQoIBfzrTvZV5mOBlYN\r\nAHuCIQ0ozz1joPW2UK1zptgeuBCWMtkh8tA=\r\n=GJi1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"b709551801efd8c4db99e1e6aa97b7479c59dcd6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.14.28-beta.4379"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.28-beta.4379_1656659326124_0.7357579032410972","host":"s3://npm-registry-packages"}},"0.14.28":{"name":"piral-pwa","version":"0.14.28","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.28","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"40c1ca36cfa1616249750b0ec9071a6bacfcac4f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.28.tgz","fileCount":40,"integrity":"sha512-xWC3+wixv03CtVXIBGFNVx0YX1bHJGPoxjD3emdfFVlYw6/ZzhIik2A40Qz9G4mevBm1CATuBYHxcQFvzxX5/Q==","signatures":[{"sig":"MEUCIQD4EjXBshdbn2VmkIOGwemnxMD6O+dpm13IUZXIu5i3kwIgcPnzXcZivvDppLfslNHNkzVj9DqnAjwFFglho57jvvc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivs3XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqjWA/8Dp2FDXX6+ik9PG0lm29AnA4mrwW8NxoH9GC/qJV5f2VG8Yni\r\nm4J07sa7RjmLayjuyYzEe6fnR86r0xaCvRwyKygfioQxN+vasAKti+oOPGEs\r\n8pmqsqQSAgVAw/6erR6qIUzS99ZpG1EsJ9Lx3BKKi9fNYS5sbm6vg5poTV71\r\nKz889D6hdN1OrvDMmENBRlDkS+rjpDdPAgN2N0SgR0kKc2QuNCQTUI0X22A6\r\nleQ/QlGttbucvbotmykOhZVV0LID4NHiFw8quaT8PZMCq51ML2YRclpNoC0+\r\nYLMXgU16DmtXg9ifns1/GRgH54lExCU0Qy5ICqw5XuVAwtJLTRbav+ekUoAc\r\nFgO1/N53Kl4cBVzS+CyAo+g9MY4NkHzS30GXpU2e38YB6S53bRB8bc1PaeXi\r\nYl5/X5aUjR43p/yHByvZje5zSN18gv8PZRpb/5Vk78XQlJlFDYvoOUAjH/u3\r\nQNjIxeuhoTvTfbphwk/rRRMLvP1q8uY8nDQwOt9TeEY+5EAoabivKCO49oa3\r\n3h7Iw4vGx1xiMibmNdwtrRSg8XkXi2d04Dp1WXh3k1mWqOb4arM5KnrEZcCS\r\nZhtdkc4F4iGC/dJFKU4N0IwOplSfEv7SwjL0E5pt4z7qqpaFpq24yQhQ5N/D\r\nRu1jUMk4Zou0A9qBvYgi0j1K9Cl5mHgIuyM=\r\n=qtQ9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"d76ab003556bd113dd00fd41af144411ae974b6c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.28"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.28_1656671703742_0.9767341903639062","host":"s3://npm-registry-packages"}},"0.14.29":{"name":"piral-pwa","version":"0.14.29","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.29","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d004a6868736cab74643b319da72f63c1bea176a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.29.tgz","fileCount":40,"integrity":"sha512-l2BeKhRkrOUyp8B1st6bZxwqwQbQkPLpcB88hnZvglQF9ybt+7EXeWbSLXN5RYfJNVSWPozCW0Rcn716eJn9Vg==","signatures":[{"sig":"MEUCIQCo+vuxwJzh13QKdQcSmqoCSRPY6/DfNeO6j9tkw2uKqQIgaGi4cyy4XFO+6b58twrIjzv/FXTtO8YIGuUyzVbSoE4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixAitACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4rw/+N5skVE158JrkHb4sLC09WgqwSMKE/AkANw7YiWC6r20QZSgZ\r\nkh0vTo3nAFsXW19vuHPXNoVZ8lbNrAoZq6qV7UGc9kzQnmg7JQOD8PbxsuGF\r\ndA7Y3XNe7No/FCt1tdGMuDcIDe7xM9O0SfVk6ipqj0ntjwLXI9pS5l3p4PwY\r\nno75+Gn5IpsdPoHgy3YKeJjd17aR+8lITQOYFIXBWkrThIjtdiQbTgN9P6gB\r\n5hROFTzMUQnQptgpW7VUphLe1vw0SfOhewH9FbqLLqr4u9aRcTK1wvDh2rAi\r\nIFb1Qn6qvf8JUSMSQSWEtyho2d3EM5Z9ctk6a8WtsBdKgSjmPCfwCjlBKn3f\r\nhou/qkJgTywKxgwzriFKnyCqVfUSxRN2fCIQ8c874e8dFV3eDTyfwCW0EboT\r\nPH/+CH+9gHt84KXTn6/9akYDpYfI8fyn5PF9EJobsj7ghVx33eacN7v88BbQ\r\nCnLHWwbYkU1RseGhYzlg9YUqnaIkYw/WPmwASF1LqDTkpCuVDwSyJvZFhyeL\r\nyU1YbsC9+KpwFGZScjWk0FoIo1DVlYgr2rX12EDJFEF8DzHnZhtQShZSLIuh\r\nIfYpTv8DFDvolFfWTNgKn3WPOLH3BGi0pP3kEnC2PhNW9l2uxq7O/0pxseRa\r\ndiKSLK6ldGjRjHU9QClL9mcSXRtVWRygnA4=\r\n=5bbb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"ebec021d9d6d469e1a318588a5c45ecedb43b35f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.29"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.29_1657014444919_0.8680220531727783","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4396":{"name":"piral-pwa","version":"0.15.0-alpha.4396","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4396","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"cc8884820ded9a8cb758dabbd0c0ad44715a0509","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4396.tgz","fileCount":40,"integrity":"sha512-lP6ovupuVU0yVVKQds55p4JKrligONM/hN0DJSCjrNte8kZWQqflDxNhoqHMPv4t3bM7iLbAdBkZjJxmczbtAw==","signatures":[{"sig":"MEYCIQDlH1bDhJxRWfPiWYGnY26KzAb75sU9ah+Qf3/LVXalHwIhALYeU2wujArxwG/Nyx48HcBujm+W94cY36ZET0JahOAt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixMPBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7Kg//dh5KAMDOcRaZv2/5TCABUQdAUbBnTYokHcy/1jeSZRg2XG/8\r\niqMoXx04cEPFEovYAwZ/TQMRsdTMHz+kTZAT7EGudI2P2lCXFDQv9UZS07yr\r\nVck3ay1c40H44K08JaAqsMN3RKdcT6Gvd1oZXoyoNJrxvA4oaTqENFxtAmV9\r\nzsvqOm93GBjwYxH8Lfwz7Va4sEbxuEKAoiAAkqGZdLunwNpK/GCN+u5EVOVP\r\n9CjPg6ZhrKosQ7v5aTGas17JjL58/9Tou/cP3oYlvUuIKrSs0/MyKAyVgAxR\r\nEK0l5UAxdU2Zhl7ll2TQAXYm0i8gdEn3SklfjDIsamItXMa8XkkRMiu5Ew7Y\r\n0/Iosz1agCbUwNb5Aj6hUG0hG0yREyQShABZMNyNJwlRaehswxYT3vsnIZeY\r\n2hXdusGkclUwINTILDQr6Itg7HVhyf/maKugWD85G/epLXbb/Rs39lUZDpg2\r\nGhjZjUu8DCPNE1VoSLTXOQEJVrkK3uOReAL0EZ9UB83+acqTc9J+Ei38KvbO\r\n4+wEbBMhopGzN06FcOW7KXPxNSddZYStnxbWaVIon6SUDrKeYwAX88o9/pMR\r\nj7LrTuExeznLNI8s+QcvEeCawo3ftI7bS7WRbm6hujy3Fve+GeLWQu2pjxzS\r\nWa7eikvI3GaJHMUenR5ake07oVn/3KrbcxY=\r\n=EKFW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"62abff4d61634b3ecffda2407f1c29f1de929b4c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4396"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4396_1657062337244_0.305164152150863","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4399":{"name":"piral-pwa","version":"0.15.0-alpha.4399","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4399","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2d4ce8b250215786cbe4a78566b7ca056a069f19","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4399.tgz","fileCount":40,"integrity":"sha512-0I7SDSvgFSvh83gq5pXQ0UWqavJEbEmq8viEnAiyCs8HteCpJqX2SBoA2iAiYICdel9+mOBpOfdorAGt/MtVPw==","signatures":[{"sig":"MEUCIQCcnAUqFBNkyAH+zfdvFFqyaJISl9I42Sx9xRximApEzgIgT8f6m3s6Mtb7/y6YHQBRcgY+O4b5c2d2bvMR+TYUuXM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixZMDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppAg//ZmIFjvZHfy0xw1zEeOqU2vjdWcNHzVukc2S14Uhah3OlTqvf\r\npk387aWLZg4/WSiUVbfQAfgS+qTzvWJzAtn5V1MSePnJqKwDTbQOoi+KTgBd\r\nGRGIdCPj6K+gvlt7mc3CmMKnTPnPuJF6X5keKRR0OfaSdsqI9Hwo1H7KUFTK\r\nvc4qT968cdRg8TsXW1yU1Ax2PKJZ5ZEjn/VHFG2/QD+zfDIC9OzIO+T9YD9Y\r\nmBfb/1MO7ZGblZvKHI2IZY7leuP5JLN84HMiRa6fxDNXmbNIeGlPew6e1lqX\r\nbjtss/WDIkqJKCIUq7TW4FXMDsoEPHouP3VC5rXh/24m+PLczUhfMrEg5ZVk\r\n/p2u85YFVbuiu7KEA3/ADH+eMxzWztTTINE27sf86afuXv7h8dbhq8N3W6EK\r\nGurKfzzgzcnDhtj1HesNX+KD1NEiF2iYvXb2u42x6i2sbzOAyo2qGMaFdQJR\r\nfIcmmlO7zFn++FvgHePZV7IicRl//9fYXfQIygPXzsf+eWos9Ol4TEcvrnwR\r\nVfqCvQrkkil5Ma1ENCDtJcj55hE+x9WotrVYnjAYQXeV5I5/hJxuAbcWhnsf\r\nBhie6qbk01OBc1XfKf2AR7iULQALLR3OzaWphXuDsaYC5vsjWjw61FAvazMf\r\nY1K+Mp5jR2kaCWveWFk6wVE6TKNlhK/mf5k=\r\n=JTre\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"34be0cac6948a92981ab4994b01b34e44462e7a0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4399"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4399_1657115395395_0.09664635785467013","host":"s3://npm-registry-packages"}},"0.15.0-alpha.4409":{"name":"piral-pwa","version":"0.15.0-alpha.4409","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-alpha.4409","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"60118e3cc7b46ae3b46f8fc9f74f464bacc97c42","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-alpha.4409.tgz","fileCount":40,"integrity":"sha512-bkRd0uiYbiVCxBB0t6rxOBaDGcC0HKvvzwRUDA69gprCiTUkyDaAOxDTO96AXJuJhUPxFsGFBnuUrOZz7R67Hw==","signatures":[{"sig":"MEUCIQD2uPPgyfv6GuYrd+VcFLx/5qddiw3dsz19CmvvSKKtFQIgLlKm0eXEIs9QllTJLvfMLNoU5KgUCs86KK4S01hhNw8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixxOXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpTGA//aV+kGpQgT0Vime9y9HUZOM7py4N1hEKqM8UseUN3fOg6EWUS\r\nFTfL1hPPB82j5ZvJusfz2LDc6mVNHPCzxQw+UvetlkT7qWXoj1kGfB/e/MDb\r\nTU7kZYEA+qCwgvPz81RJ6lOK7g+wewlv+RidYvBOxWQWg8mXznIGWSUj0P3y\r\n2cUDLADIqwKFu+Baue/UbopXfGR6t5VcMcG6SFIttKulJKG4FNV7/nd6idl+\r\n9Sy3rlNBRf2UYJMdZxsGQbe7cL0Z0qo2/s7yHO0XqOUOX5SODP3d1bkYdVER\r\nWsEG84uTLNlPbZydvrFJwNdH8UbSiLTIwCzszuW0UIjFTaXTWwZ3HNnZoJIy\r\nMytf3635B2WkM5bHmpUg3pz6iwYzGoBCUdUu6QWiEPpOU0fftkcCT8Z0bIPl\r\nzG6mltwSfdTj+soMx6cGeIMYhPiJWlnFbg02t3YlR+zlN1a45tIx8+vGgRq4\r\nnCSdJoiB31ZbKl8tMFL0BeuV6qeWBo6Jq4QUfKuHfLFQ0gc98m57vaquGYlT\r\ntkt2uEibmmHMvGlgw1f5a7vrXh9m9J4DsX59s2//BW90KZto5+HriHVK+Huj\r\n3uk+DNn2mzfp3rSUbLUIy/wrjm/Bcb8hfIjYxwhhqgE870QpXBYikuTMgQAF\r\nkOst7XfAh/Mc2Gvhroiof/11ZyXSSMbu8po=\r\n=X2xA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f5a0a4bb26fa2074af90776fa4a8b85a3eb8369a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-alpha.4409"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-alpha.4409_1657213847029_0.7004784055635354","host":"s3://npm-registry-packages"}},"0.15.0-beta.4411":{"name":"piral-pwa","version":"0.15.0-beta.4411","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4411","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f5517b505014a76cfcb52a130fec52c31e6bd29e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4411.tgz","fileCount":40,"integrity":"sha512-nFtfhIYt3lFTIiMvgLEd4szZkv8i350fBs10AowCBENjoDydsXI7s3Q6VIrFkvdiAD4wzOLkRA/CLHMm+1dmJA==","signatures":[{"sig":"MEYCIQCwA1Ozcs9W1vHBeceS2tplHyrU199AKV6+oXcEvUkC7wIhAOx4LcXvKfmx6k7qiGpnYOlaU1/pkezzHJfs8f1XINUX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyXOIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxZw/9GraC3CRj+LL6C1B4jksWUlcTt+WsJ8vbtxn+mdVWXcX8iC4x\r\nQf2+jf4Lu5v0LexkzhOIMwzvgbEjc0BoP6VzDkIh16XGsHfl433F1ce+1J2v\r\n5UEGMUIHcY/DKu+vtIKUkzJ4Z+nT8n5livHG1le2wTLr+NTK6Ovf6wMyEbB9\r\nqoQwdRqWuZru6ODzckE72JcJM/WDKtcZdMkvvJWepxs7aZMOHkEF3bg3pCuH\r\nJGBat8ojZFcUebPiCLo/T5qYV3TQnu//OANOCORSQytZRBN0qRuEfKoXLkWD\r\nooCbPx/1PbWZ+cFxjlk1/C9oOa4psgD4VKRAlMzSkt6Fhqlk7ume2mfdF4NA\r\nLFUjw4nidu3oDdPLt9aibv6ejSDFHN3+Ttssp83j6hUB6QelZXr1VN0cXlfd\r\nkRvVqoFS9L8mv+4dGkXVO15Xm2j+e5ggDKLB8kyhPPYXsPhp5h5Rbs4N63sm\r\nrjwNKFPXzAvEAVL9fut2Q82OaVGd4yuQM1OyUVqUrgg0Z6jKdV8E1JaJacz0\r\n1lZAK8fowKgnpG19Aei1HnK+8lFLUbwXZUKo3eFSQbCUXUZEXP08yD8ihzbH\r\nuaQNq1EQ1MTmQw/wluJjjBku7TTMDP0Z++4hcHt7XNGbCNKim7WCkBFIKJta\r\nYDUzTaHlfBrp8HC/vNmTWUyxF1BNPMDO3Go=\r\n=Ee3S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"4f5faf811d34692b5f2d3042b9fb732fa8d64cb0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4411"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4411_1657369480078_0.6782859878332232","host":"s3://npm-registry-packages"}},"0.15.0-beta.4465":{"name":"piral-pwa","version":"0.15.0-beta.4465","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4465","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7ae361c88be3a0b9be62fd99b16339e2a03a9058","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4465.tgz","fileCount":40,"integrity":"sha512-+Wz+xu8MMHaRDqwP9a+/fSFghm1kSlnhF6hy+YdIMi0IC8vDIv5ew90P+PHN0dpHLi7G57p7DZlQhsKLTveF/A==","signatures":[{"sig":"MEUCIGvag+J6B3G81OrCJ+VTrlAJmZ4qTqlvPn080usKMjK1AiEA426wQm+z/5y/ZM/szkdLVOsLyU8TQE2rj5gaCcJQViE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2Qt+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6YRAAjxwLySUddo8aH6SVG3/1C/wLmfreKJBaYxbjDSG3Ozrps46v\r\n5VQc4UqpXi1yz+IhfcwGMTnd0yAVEPXV+MUpep6GHkoB+yOu0UUrRc7CAHXY\r\nJhRKZZ6We4Q3h9bm/otRv6HzzYa/OvFBjV6w8juoUbLRw8o/sanNIK8fqdOo\r\nYYwIHPipzwYfyk4nZTTGiQPk3XfIzHmfbe9IUspY2v27RhbLpQjSnSjGFKsn\r\nGquVZ2pmHa71M0qXTZ5N0PuAlMyDwpHHyMrlYnKrzygRHAPmzltjfp3Z6PMQ\r\nX/2dLdDwV9oaF72dQPUWdh7hxPcjA2UaTb3MuGZr96eTBafRs11Io3KwsGHL\r\nTxT6B/s0SaStLpsEYOiClU56YanhqUdRk2YxJ+QmZyvHvpFIjqxRh1JTatOc\r\nFIfC8bVi34t+XIWGShiwxtXgH41frtRvjJb/YhMQYqCgRqGIUeSW4xRKiwgZ\r\nuqr56zx15Gu0QP1CoYSH9SvHUkqnZysG7FwlEcbwzlRe9SiUC0t/CoKhBkc4\r\nzoxAJ4L1f1eA78tIm72MmAfthm5KcHqd0K+RcH0SAqR5UWSj79gxQL9Vifob\r\nS4lsDiceSLK2mrwTrai/Fp85u0ZB/vjcPdQ8WtuFOIVeqBNuGyN2CZY6eN0/\r\nwouySeNCy9jyruUalAaU+CVzNhApkgoq4yY=\r\n=UWrE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"3c7c64ebefd180d4e1cfbf0a397ea1c68063ae08","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4465"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4465_1658391421961_0.8400408522375815","host":"s3://npm-registry-packages"}},"0.15.0-beta.4466":{"name":"piral-pwa","version":"0.15.0-beta.4466","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4466","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"65f8f63e950c46a82812487902c92873a451304b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4466.tgz","fileCount":40,"integrity":"sha512-7M7Taq3k7KgpcsEJmyKk6sXoYzX7kGhMHmkUYnVOu5VcbdC/OT0hfDuMD0aXj13m4Zn8fyNpJT6xHHCUSqoNUQ==","signatures":[{"sig":"MEUCIQDiyTFSdMuiZqWe5fC5TaLrnV2HDmGJKxuu3X+OMJF+FAIgHuZgiKhq1PjCTX6jptkl7W+XioaPFiumXUSiQ6yuwYA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2Yr3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1tw/+J+xwaXbtWh43nwTmv1KClqWE2RgbINJekURw79lT6FHR42jx\r\nCMYL1QLPelwFo4iAPYyYiST+YzpXD95hxf1/e+72wCiYnIImsROV4RKiI7HJ\r\ni1XBCjVmV0QGxhdvuKgEiK4dkfseY/irHB3ngLgB9HNNdE/22yLM/+mOzCB6\r\nCrsLZS61FXBywGOpLVu++NLRMV+lsAyqa9Vd6/BSBGtWSb+xicPkUDYbc5nS\r\nCdb6oxdTvI/PmQvBlHh+Lf+2iVYAnnW5EykUPDlbcbUjl1GOFTSe+bP18sdd\r\nm4EnzPIv7Jt/HouwjuljLg/21mCiJCJm5ETYrSdZpzPPdmhqxB6Y9J/DBW1R\r\nKUnJHvhzbBTgPfr7NUNuV5OjHsyWv3s4aEmgzxK+EIM2yvzxmRHspS1Hr/c8\r\nmrCbxKlNqPRHGk651Q4P4bN4wRs9cqAyEmbPRABKZelvBhmkce2ewV4GchrC\r\nTf/oOW/rz25MMVjI/etUSCMIvVq0r7rKWC7T+dBQ4pGnS/1+GZ0mravgpmiF\r\n74lZHgH0afm44vEeiDlf8BeKDjOpiTEbPjUVH4C39A8EG914u3B5Xgq4TM6w\r\nCG37MNhg36SUwg48LZsBSTddYdUI+NagAo8p6uSWsck6qQaXAiNXZxgjKk0i\r\nI9DiyYZ8SNLwqj4+/O95Wggzy1Q5fOCA8vU=\r\n=Kikh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"35d20c9cd14ad55ef8148f13a4fbf70b0e730df4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4466"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4466_1658424055556_0.9233057205174426","host":"s3://npm-registry-packages"}},"0.15.0-beta.4472":{"name":"piral-pwa","version":"0.15.0-beta.4472","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4472","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0f71a11cfa7fc0137a050f7b203453e3ee4be17c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4472.tgz","fileCount":40,"integrity":"sha512-I78dSxQ5oK4wGoqBnJW+cSZ6oSQjEh2cNAdP6bIfc7KjxfTctz9sNQzyPqO0vkajdAImqLiGUBRzPrzzEcABzA==","signatures":[{"sig":"MEUCIQDYzZabzu8vHyzbKvRbaDwY3qt0mx61yfDbRJPguERz6wIgdG1Do+p1YJXnMC4h3/aKd+t2tqvdOtz3AgFi0/nPA0A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3ySlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNRA//fUFzzUf3b1hDELHY3SQ7UCGLng6NmX8UdxzEtyjIR7APlW+u\r\nA9FAY4x/BpWAeilPWzAC964bXh/ptKvHBxOyxMg7+gLL08dtPP3JVqeA3LJ+\r\nShqwIoNkZ9JQj+KWwtafaMuFtiJ0nAIrUEIBDapCWhK7utrI3T6W96H0ttMk\r\niNIMjUpHC1Meo68x2GGSAX2KEkxrKRGnhLS20J/i7538fAlnXUMFHWBTTmVE\r\nQ9wzSPflODzRCgCboTACFJ7jyfaBMHqFylGI73j16nOKyClEwkUj2X2/C0Pm\r\nmeGbK/82QGqceSrmfsLUgd2i0ah53QoMhvGO4ZTQUNpNlAyvZcWztbcrvRdQ\r\n+pMuPnmi83KbamkUkRYpnzbZCk1J7gLoGx0K4CU1FiYiWBUjzzVWuh2gpqdo\r\nKeJq0/sX6T54WFRONpB9utpLJ7SvdoYarKhgCCYxSEIdmZXache0KnBAZ+KU\r\nAmUD/hL5rgltzOngmllHIIRCOLCDTXaaacVb6fTofK5BQXRS4oyfFOAKNKGI\r\nsvdrJl/gfhBTUI3NV8GgH0h2WXo0GgQPinFXjccaAYG3WB2j/CjbjHW1sYdG\r\nJ+xJuzkyXoqfGfjw5ZhSzhoEJKevUA6O3Noj8AdjwDDG9HYRph1c3NZCgQnp\r\n8F0X2BYJHpts6isBODlvf0XXITlJdbYNID4=\r\n=Jaf2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"327a25c420b779caf6d2ea2edfc7ee59acd94a5b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4472"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4472_1658791076983_0.08065979617677166","host":"s3://npm-registry-packages"}},"0.15.0-beta.4512":{"name":"piral-pwa","version":"0.15.0-beta.4512","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4512","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"97ec90bb4ed0e08128622a3ff85d62250c4946a7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4512.tgz","fileCount":40,"integrity":"sha512-pdMReymfw7nVzJrJxMzcU+NnrBpauqw9JSoTWmHDjecoKnhMAS7zuwCABcXHK1F49JiEw7HJYlFScLeSXb3Wbg==","signatures":[{"sig":"MEQCIBCsegWQFOZhyXZ1h0IowSCWTjDQQtZMUxXDHx3Zbz9UAiAuAZ9a+lxR8nLzpVR589htNVZupRhfQbQsXeqofAJ01w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5Gj8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEQg/+PKU4rREKYvLEebvqNAh+JFudu4WjisPcOaIkfgNezLElOdvE\r\n8tJnYLnNVWIc8gINE4JSIcGOzRTbMDf52QZ2QT//ho7iMmbPvU3HCg+a0Ly9\r\n4TcPFsLI8tpQVkq9kmVeqnTadDPAnUNFu7hVAmhEMaBepFBsZ1roVqJhIkPV\r\nMxfnvi0IWvFyVz11BM/tWR5w7H+T13TcB36STga+r+/O1kUNqjG1rDloLJMd\r\nLCqLE1ckTpNn32XeZjwLDtCxccQKXYOsNKFrCeTJwV/8jv1WwcT0S1EQBHVQ\r\nBhHR7nt6OIuVBReBDceIYVSkPxLvPEt7F4eGvjm5rjdes93QIvFCSzp2xqOR\r\nMZoQ683fdEMZ1DCJhqnay5UltSafS1FFikVabP8TRJkE3INfV+kKfcYRYtNN\r\ndUFFi3r4ehuGj+dN9Ye0f1Bho6HFGCgKQlzRr+lCFR+HghG9o+V35Z6uRWoP\r\nBFwfL1u9lVB+g6lIHW489c+bihbszumb521edZrY/ua5T3ywNxVxS+UHDcjt\r\nexEv/MmH+ZUFQDHv6XQKKOAgX77YFNf13sywbJHTIsYOsm2gc6Q7L3ODcyzg\r\nNoXVM0I7Q0THpYMfJStjRKguksf+J9fpLcMlVe6ucAF0NCP313xnIE8u65sC\r\nqEJ3yBmHT0XR+9DVNtPaOmFx8r6quX6C1rw=\r\n=3d6c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"8c26175fb38ac3323c30b154d7ff28c13c29cb39","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4512"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4512_1659136251922_0.9408402609056112","host":"s3://npm-registry-packages"}},"0.15.0-beta.4544":{"name":"piral-pwa","version":"0.15.0-beta.4544","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4544","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9e7e3fd3ac1f20d8d333cb012df153dad1bd5d68","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4544.tgz","fileCount":40,"integrity":"sha512-2515kz7w4apg/tbMj/3zimAuzl8+bs6QiObjp///SPTEmqXQ7xxIrcLWXaGX2L2IhoBVdDxE6gXRoKxkElV4Jw==","signatures":[{"sig":"MEYCIQDMEjk74n3WZFSckUxvYwGqj/CIo4eDXIEYE/mNp/zbGAIhAPc2E24MjN4lzqzw/3j/ijBj/lndULyo1KuS5TFCProM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7N/YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocFQ//V5VlivntkTD1tAiu/i2Kl7yioNzMmmW53rBkENLUqmA4LBHh\r\nONFFdiqAXndP5J/GvtMnysTCnhjPovYmhEd+K5MUnbDq1DE6Siqwgg3z+UB+\r\nNAHl9xDDeg/o9qm9UbXt754RGJp9ccrDsQv5nj/7GIGbDn5jEFi4IXfV48rA\r\njt4rI5xtTND9amMPcO0PPcA2o1uNB0bDBiDuLYfYWlDUrN7mzpGMDQtK9GyT\r\nMO3uAQPd1bb8VkesW3s2YrSOsqAXX5QvqgqrhMEazbo8ZBBEONwXDR4c0C5k\r\nhNNVJyWxZYSjhdyIQlML+PO/f8G+G63MY2cU2rbCeZjpBR+QYyYOYSFeNSFr\r\ndc6O69QXWgLmQjFiXSfH6yeELPnxgZhzjJ922eSDrWO2EtMF3UnKgf7WoTin\r\nIfGHvhUI2n/s8ubDYMu9cL1+dHIiCLxBjAhbjNvRtuSCN2Oo6+dR2QyDwxdw\r\neXe1z42r0wLLctNjZFv5kTY+ci9wNejTEzjcE9Cp/fbdZd8l2uuRb9+L3dyl\r\n4lQGkLcMdcBU+maR+9jPqK2klcmeB/3pmKrkiZF4yFKfAF/82jJcol7GDox+\r\nBWsH/dfcyvsqVxlWLalBx2m7sVijHy5luQQLLcdjYsJtSdJhs8ZHV0Q1UUJu\r\nH7HxuCwuM8lFh+JvzXIT7qLHbYWQTlPraK4=\r\n=LBWJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"d128ed2e80430bbedcc16644455dd47c958addfc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4544"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4544_1659690968328_0.19594812900482816","host":"s3://npm-registry-packages"}},"0.15.0-beta.4549":{"name":"piral-pwa","version":"0.15.0-beta.4549","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4549","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f1368097172a602fa1774f1d3fca2c490b3e5fe9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4549.tgz","fileCount":40,"integrity":"sha512-mtDeaXIX4XhzKd9VN6mQKRwu7BVLEfN4+iqb69x/GDVE2SIz9E4BbDRVrtrSeDkcrT5i8EG2aLCFsl9F05AAdQ==","signatures":[{"sig":"MEUCIQD8FCtY4E0BSsMHVTe2gmcUDE5aW5ECQBwWO4g4su/iWwIgJ3aaje9s9QfPac2IuWPUevpRb6RKrDvirneTDZdJc6U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7o8nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAAxAAhHSER5OXwJLiicQVMbMIo+OylEu4rHVX9Uem4w+xPvPABOoM\r\n2rWDNYYqJ8sSIoEDAH7q3wlfK8wB0URRI5EknWId/XJZOd7xnr2jgHBK8BfQ\r\nlAmtSGP1lb8F29neDCeGruFdw6DPkyAJrLCgi2caXBKxemzXds/PbdzwWz9b\r\nmTKSFjoW7EBhkVH9LkhdtbdoktcPXcjtIzK1TwFpvN0/8udo6vRNPYH0sfkB\r\nxVqEebXYUSJpOLK9bXQvvRHe5mZ3hyvn0falgyQek+2fxeOhJCTDxbgIH2lu\r\nRDhUWb+qBGPhps3cTIWcWi545X5BFRz2dtN7xeN5O1Poz2WxlFkZCwXbluBf\r\nxO6NSm7pPxH61WGcB0wjy17YGQGBvubt7IBqk46u4NSi4vYvFaxDMuYnIQPw\r\ngRwilCdC6tPvDdaX2emP1M2NCVIr34heRAxVMqMcPnw2shUC6CLryuR6fxTx\r\nLyCJGaHHpngJqmKfKbZAagg+B+Vyb9Mw5XTPCob0KWz3fDFxXMk/1207KaVQ\r\n2bZHIdHCPNJlNV/crbByabAYw9vY+bKxQ0eT2Bf9NWV6AfZ7QGsova0wmHpJ\r\n0DZj1R/ZzsuiRpXtE6ttcoRGEbQq3SPxczmdwpFa+QVkwYjwEXmHrApteVkN\r\ny3qQBfLaEUoDjij83VmhKyeVJyjpUZwSR+Q=\r\n=QamR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"ca7224ab671fd632fe9e5cfe9b7f573d9a105ce8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4549"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4549_1659801382798_0.764665999732945","host":"s3://npm-registry-packages"}},"0.15.0-beta.4560":{"name":"piral-pwa","version":"0.15.0-beta.4560","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4560","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c068c51c05640601274c9eeefb4dbc03e13ee035","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4560.tgz","fileCount":40,"integrity":"sha512-UfOtvScwg3/OO5GE1I2YZ3ehKa3f8SZTPXOVQDNZsP4zfY0fERrfBJQtUS532yZgJuWCM2koyNEisFJGimHUZw==","signatures":[{"sig":"MEYCIQCD4CEkQ1nSUP1dp2JpIqKUQW7Q7Ly+LUtZxUvxTbUOVgIhAJ3kyDqk4DaQJJbUskFYHQXpe0D+e4uRLXuZTU3Y+G5f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8OBRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKqw/+JE+DRoI/eCul2bCU9r7E72Ns6w505+bOBFq4H1lpOVrry9+e\r\nebCZSbAo1CUpfO3QkReXKIsry6YpB6UpMtU0yKijx3I59dBGNhZXizKQyaBK\r\nRiTSVlo97fqv/B81Nj6E4GWjjRBDmfqqXp/P68n7wL3J3dUf9R4RRg8VhxWK\r\nIgQek+BoGICSA3l9utKmgcRZGVEVV/GjEiiRg5B7b86+Qpls7JUc659bZC7Z\r\ncOKGySxPLOY9LpadGnDtQ4vyQjP+fzdB4GCwhZFRDeqd94E6tnIOocXf6Wb+\r\njIOJZrNUBRUZfLsmVr8Kh1nCStwx91H0xLc31QzmsdkC8PuuUvzci5aQPdDa\r\n8EXdNcmW6yQ7MDby/X/MtwoAUSduc/0DBfRQQfasyD58TrekRL6mvlToT2V0\r\nk85eYJrTxm5gK00EkXua0f13n91eELsYNbCnTGpeBBp6AfwsxCw68hwVwCpI\r\n6UBxZYAeWmRa8yvPGmtilItQh3WDgWZ/dp46BxRfh+4f6ZNOzr9dHFkYmrrg\r\nfBhS4lPE0aYC9X4/eaF4+65M5wbN45Yb68LBqGLYrXqejhx9VAyhNYClUAs8\r\nBXBuniyw+qnZvj2JNZG3zoGK/+9/8iIzNF2JVVFOXbrIvnrRBnS5AfCvn3y/\r\nUG5IaWt2UU+UEVYkL3G3kLbmJZYz9cgpIcY=\r\n=W+pc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"b4fa0e9b24f7b8e340dc3a32d0e37d21b3d26c3d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4560"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4560_1659953233668_0.5545757425655491","host":"s3://npm-registry-packages"}},"0.15.0-beta.4574":{"name":"piral-pwa","version":"0.15.0-beta.4574","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4574","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9c6ff4c3d7c8aaaafccf3d8018617a805ec63d2e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4574.tgz","fileCount":40,"integrity":"sha512-YZEF3nhr6j0PD+HKK8JEPVtPNphQSslZMaNPHt3g4IRtRAbX77ILhQEE/AuAZzhThuxUjmZlDXDBncH8wQGscg==","signatures":[{"sig":"MEQCIFwvUAiiytmANKKn/pOaGp0xDHOxKgTIMbm0+CiYh4yWAiANUA4Y1NtaYMUzhMa3JXFDoNpWLa8lrSf5uy52otAb7w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9QrqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/qw//apQ+5CCdiy0mNL5tcw4JTkaz9OPKTFZuWyHqvtPYwivubluJ\r\nhidx5kuc035ucWwvOpPQp9+OUu7hH70cQ/YuEYUOKKCo8goQ5ojTwZ6sWSd3\r\nQdubrvPn1Tt7rFbzQWO3SK3hqasVZV8Emq388wE2iJqxza6Qaz7sSDknB4/s\r\nTws0EsSJ8AOEv42ibI8Kj+ceZB0NN3uBMFREhgvxPFAg9y0KLrtChzjkmiVp\r\ncsNWkzGe4+aQSf2y4HCN+0MeGym44p6urrR74yRvRD4bGXgvYqdTcGTEbG5p\r\n3VgLWuq2rIH7yDjZDE/KvajS3/dYSDAbqkhCyMUtXFd5T7Ic8fIQeq0v04Zd\r\nLkZw0mWDMqL3Hrb+cPxp6aseDYYSAMDwr6kuLJRC6s90nwg7a2wudUo7JKWk\r\nasZ/pVQnNBI2DbcEGuDQBHStHj1gya3OuYh43HIJd3sGAlkXxlHLlRL5LBwE\r\ncSC7SfsTQlnIZYL1EpZU7mc8cQiOvIVTaYDZ2OqZ2h+kc7eF4GZBSQJ2KjWL\r\nbuJQs1R+X9zspHHTi5GGWtaOeBomcSN8SOXbDpC0uaIlVjNQzos5tKjSRGS/\r\nXCSzfkdhSF5lFmNVDC+am6ueXkwJsspREMNyQ7Kvio7VRMF4rzWAQ0/B4oZQ\r\nLzDEZ2ktKqHhD/LN7Av2LZL5tjoJ08IYSZo=\r\n=8cGm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"914a7b4c14d9b161731f80756f3e175f0444e874","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4574"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4574_1660226282230_0.6100822614709163","host":"s3://npm-registry-packages"}},"0.15.0-beta.4579":{"name":"piral-pwa","version":"0.15.0-beta.4579","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4579","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c8cb20f66dc2038e68223e4842b382bc8ed4c2a3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4579.tgz","fileCount":40,"integrity":"sha512-QpKhRjD+8CmGJgnCMvQi/6Bt0cXfIv/exbuzdgjOgdjKoIkETieHwWZql9xjZOqud/ZG39eRNJ3/2HaaJBijJw==","signatures":[{"sig":"MEUCIFUGPajQhkGazJBbXcowS1kiACvjukr9FNDdFLjH4CAoAiEAtjOcmUKk9oQPDJJ4KRqu4kVvqM9bTnhzdGKiiX2ZR2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/AyFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpvcg//bDzGxkLe3lW3ESqDdaAy26hqYwhvs96NlzZ5tz/IcVPMfZNC\r\nCWDWZY1hPaVPRHGldxihHNDyrnfH3VdciZOaCaGOs3PEmDIQ2rlT8ktmHTro\r\nD2tIjMv9IKNze/yjprV55LRfLavjtvjNbw5o5Ar1pFdjdzyiTzJoeS293uQ8\r\naijvh0gVQKXtfFtiAliHtyF5sCpdvYOlqAMQdBZP+p8VWS0M76aIceFBxkUK\r\nSyvxVM6rY6e0F6tkHvbDyTEkZGhs0zQL+en+0V5Pb4piTAQLlUCk/dPBjA5o\r\n6YVWBpkrDuyPC0Pbaefh8ZisBATGA3np/i/ZBYJs87nhJacA6rPp0rZ2APsn\r\nSxaVmdAw8WTd8Q+q75WeMzEcqrdYRkKHNCIV69aw+2D4To0tr0wWQkTbtbD4\r\n37ySQHyOC6oNLfoxIXXyRnEvLYZ+VBFmyHNZrK27OI8O4K5iWSBKcNQR6jux\r\nsI2AnOlWdnytQj8xdHZ1ivnV+o6hBfKDMahfTnazYGXZQa1KC0QOqCFk4Sp/\r\nBApUPqx9f7MA8Lfe3ZEpMFzdBz0hVanggYzJgrKKz55gUfkhfuCdW8vbxiUM\r\n2P702xuj5XRBdyLvmANSKvGHyrhOsezFIsAywTORz4382r5G52N64JN2vWj9\r\ndTLuV/5TuBav9MHLDEZAHTzXjVg/yxsC6pY=\r\n=dMXN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"a7c4837c23014ba2038aadce3045315164a98fc0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4579"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4579_1660685444900_0.6623037013748028","host":"s3://npm-registry-packages"}},"0.15.0-beta.4607":{"name":"piral-pwa","version":"0.15.0-beta.4607","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4607","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"54352a2c566ccaa374835946ec6a84b7ea7219ac","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4607.tgz","fileCount":40,"integrity":"sha512-xGXI5d9evHiAlxSVMyDY0TNHSdDcFqAiRqgdH1d0FxmnNasjT//T7FZ1HqmqlCAc9O2+3avsb4pNyM3IHAZjKw==","signatures":[{"sig":"MEQCIF+ob3jAW9Ft8sd409rpD3P2+odda/K4DL1C3XDu2pNXAiBwyQidILX/yj0+N2+fpVv5iXUgOswe79XcB3q9jiqEPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjB3WKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/sw/9Fnrk5Z8tXGD8yDbeRdUFyU1eJN7Nh1ng71vCtgBLHe2dEXtC\r\nzsE9kPzQT/AydKoxs7whSXKQf4i0eoURKDB2esWs+Usx0LAhMHxefGvU3JYS\r\nSgopQkZZqZCKKgKrL4ub+N7fhjFMJvVc9srosSF9lKU6qCRrsrIMigh7KT3o\r\n/nsZExRhnBmAn7sg4Dui77M6FCkJnZ/K9CPmTO/+yyPf554PU4n+0u1XOT9V\r\n34w425HCrPvux0D+D1TDL6qzH6rdUkF5qIMaABOxTS4qgbEpIJy016X2TUPf\r\nJCzxBeX/jwD9Dr3hkoDq2EWcHOO+GxKSSGNXS23gJ1oILgfvztw7LxPju5wC\r\n6G5YLzRsdOtD+SVnwIHmlb9Cbq4y/nVyFTcBnuLI2Ra1Oc7vTgeS9yZQLmCC\r\nl9ceBTaEzCun+XGvPffecW8ep0Oo58LvbZmQnz2ZYXnadMomZT6X1Mtlkvs5\r\njy9cJjUAQEUBqiFO2nOOd5EyVPext/PadarsqcU4m2PQPaqavMtYgWKxGVB4\r\njm7UAjXnNCc0P/xI+x6frCccY4shxTGoSAtvh/+vFI9iM3QxIRitYd4wwyet\r\n2IvAOnlCXHu05AKiwHpvVTCCtJHCXoHNSUQ0257U2lKBXL+d53dCWAVeqaCt\r\nqO42QPOMwznbCJUOHyG7Xl/xzuYQfqqv2lM=\r\n=mC0k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"2b1f8f84149c0ddb5020a5df0bb1b94dad56f386","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4607"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4607_1661433225809_0.5270799068201479","host":"s3://npm-registry-packages"}},"0.14.30":{"name":"piral-pwa","version":"0.14.30","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.30","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2b9b37caea857d21e94c7b1e8fbda4d5549868ea","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.30.tgz","fileCount":40,"integrity":"sha512-G41yvbSRM9uWgFckQs8VylngIjZpk8veF+DfOR9XxGv+A88WLGwvTbTcuAmtMzoM4su47HI1FbIUHP2G8TOOpw==","signatures":[{"sig":"MEUCIGqC/LJMcaFuiZrc5IgZF6V7X+stV8JFPAt7L56WKEPRAiEAurgCTCWu7XfFjiW46F7/2mPQpzbERiLC7g9D4s3Fx3I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCIDbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6QRAAoTC+G70vVpmg+z+u5jWeYBobvnoNWOBK0YPeF4sXaDsCD6UQ\r\n4o+0kzFu5yNGu86Wm7UewLz3L+qvAwp3Ihu5U+8D4uU4Ck5EEsedpKHtQZui\r\n3u4FC46e1j3bNCC+2l4ZRrgaH04ebCI+e+xXj4f6FxiZnhdZfnoau+NcjpBc\r\nRFFzxywKb6UjubfLXo/C61NFpFjQyV/zhhqTMH05iYmKtbujbENSv7eHR8YZ\r\nt/zNyCT1ijDhKaqgONlPOjKTPwyEDcBAHpbd0CL2P782hadvolgAbesfFavA\r\nv/wfGeGhbJv0AzxmQJeVQUPr7kfIydkhkg20Vrd8Ht87rsg1LWKgMyRGjWaQ\r\nQjtxLwunNeRudfesJ9vo7tgAc310YmdONAl5VkxvNXaMW1TbTgCmi2pw+FJJ\r\neb28cat8jtb0ghk2lx79HYVx8ju55GFFNAA1yuGcxoP14awd74GCFBUA5ygM\r\njdej6fya8ZEs/4OeJKAX3mX9OXRE3Zwscm3WnQEJL7A/jNfZFoHu8KbHtRoq\r\n7N5+7X6tCD0k0TzRXkCsMdj4SPhMRzXBQKzLZR7jgvgnK3G0hU3r7v2S093F\r\n5Gl+uCG6WcnuVdTfjbPZqTRuabkleo+Yjx58yWgQNmqEKrV4oQx+lmbvuzLO\r\ntie/ANJWBQ+eaeWTZHD1n4RfIx1Ku331Cok=\r\n=EuVW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f8fa71fb0f71425771ceda09c17080bf15412002","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.30"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.30_1661501659148_0.3784127495317895","host":"s3://npm-registry-packages"}},"0.15.0-beta.4630":{"name":"piral-pwa","version":"0.15.0-beta.4630","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4630","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"1de84760d6f3fc3aeeb806d071681f7fa68a69f2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4630.tgz","fileCount":40,"integrity":"sha512-x/Edg6wsQJ7aFOc/T7Rp2V1bEMPUq0kDXFy5B0DqjVghHOR5hDt+C2lYm3QSTmF2TIRPkrnC4aNjj0+s+8S/1Q==","signatures":[{"sig":"MEQCIHLelB0CGPi94bRw3UcIHz4/pTrjQjLY1HFLZsQTGge2AiAJw45rfFxFDytmKYhTajfaEPC+uRoSoGcloxySb2b7Mg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDVKLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvJA//Y6RdeHRf9QBptWXFvlNN9QIbxu8pNyy5+GRU88GASJV6xkUE\r\nRvk1iNw/xeVnFtzRprPbV/sp4IDrMGLNZSeqVrnxpKRRmpK0ahQrMU4efWkc\r\nBsZZyKSL5NAddYFA+HahA82aentPZ3CJZOX18NMgceQP4BffVrFwkdTuWx6z\r\ngQAhbb/RqKhWZkDGYeTAgyQCI///K532JQbWeCfcUnu5CUR7i31I+ZhZlUmy\r\n+5y8x/Ilf9B7Tv418IK4ughSX9kfUIjZHKnSU0wWDcuEFd/DsYAf6e3nvZLZ\r\nlRoYxmCBEWP34Y6PjkOpeHLx/Ad+UGTmgcaLj5QgVXvU2Ia9FqRGlxOftJV4\r\nI6cTzqdDeg4C1P0bJeytPQU7JxQPszrxrdNp8cMg2Z6W1Ya82LgcmOtYVdGX\r\nXvcPWhzvdid248M64LuUU0ob1UdNTOwUCeG/xwx4vRHC8XQEFE7uGY0BxmMs\r\ni7pQAiqT2yRjEumMwTfzfXf+/En8USYUm4dknFtOxx95m9gnp8jEngp1KPWn\r\nLwK2AjcRNCOhLqaYqigOFfZ/WyR4+vb5tOI3mrtwDfKhWscdf/aJgd82YMU+\r\n5kJHKXdufHI8Ks1geRZrS1C79xHUuIWdz8cUS8Qer0+iyotvLQhgIWDK2hUA\r\n/Hs6seSja+JGvJsn3J9mD1mZxy7fsc2ZyAE=\r\n=B2x3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"08aea96af9587e73b1a6c4eb108f94f285186b10","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4630"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4630_1661817483285_0.18647197218546974","host":"s3://npm-registry-packages"}},"0.15.0-beta.4633":{"name":"piral-pwa","version":"0.15.0-beta.4633","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4633","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d5524d54ea626ad242a663b6d9ba439606f13458","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4633.tgz","fileCount":40,"integrity":"sha512-kXafO/O8qBa6KyEZOgfDS+SZVdQgYxS2SO3FHfzkmVPsVBkaVIshwz+MDPHPAC48iIyEKvrKDrdO7XIuVCAQCA==","signatures":[{"sig":"MEUCIDer1MJhcG5K2lqoae44kc/Icjook06b1N78LktNQKWnAiEA7vK2msk349NuDJ5VQnXMGO5lXxKTFsxBwHzxKMZmDjE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDmRlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrnEA//Si5JtW/HfgkoW0jn9CPJQUltwciEG+7g2iB4/QePBTPQa+A9\r\ntBCC4ugvsESbYoZBS2XyNqsLyfkQbYKJu3ugNU1lqdKqY7rQ6a/ZLS7zrjbD\r\nHKzG5z/PNUWi236UOJCizrCicn+t3T97kcJJUdwYhUypvNGbxSC6fw1wFtvY\r\nt0p3UTKLtHaLBS4tiyDGWi6sQAUy9IAIdjVhW8RcISNiw8bSlOUEyl4exdkh\r\nI+6QiYUdSPO4w0Ov4w31TZbw6pNPnJe4cl94Fz84rOo1wTOt0dwAL3nuarQT\r\n/2uApIXM3CTbKZfQ2PLVRnXfRN1VYHRTw2pQVC/+HNfxwlJV3NCBWJx1Yirx\r\nbuG5wL4NJTD8OpQCqLmy2WFZLFBQCO6tIQuTSFm1V8QnsVYV5C4AltZsLvoT\r\nOfpLf1JXUUq75t/+wVBTGlVSKalJMW0Tp/kQbkDuIMtq/iwbXo6gwiVvEob9\r\nxrAVJ38E5GWOF/YbXdMKngq/Ej2EETHdaVE6qiYz/j5Lld8umxsgNRnxx10Z\r\nAizlRZLdveQIcjheZFcwplczdZRrVBYJrntcmIim20n/YtSzHi7DS+St5EyR\r\nHQFjxp9HVhkNOUwsSJAAL/Fc24AElznLT+1va7SfxDkZl01R7DN7J7GHwsaa\r\no2oPlz7HCg0DtWZC93xY2RCOFn0ilgSJyF0=\r\n=kyIz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"96b950f26e9673595f68518103508dfc76001761","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4633"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4633_1661887588853_0.6037017491188548","host":"s3://npm-registry-packages"}},"0.14.31":{"name":"piral-pwa","version":"0.14.31","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.31","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f468a0633f6fa903bddac45787f5d05a81436fe3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.31.tgz","fileCount":40,"integrity":"sha512-WUsLnxhXput5jXV7KWR7nxoxU4AA28JD+8fEziHUY6fFFgEUPR0MspximnNmlpVLwwiiaZshgOz8Lom/K2oNpQ==","signatures":[{"sig":"MEUCIQDPrnm9yM1kqvbPWFMk5NfHVk3DX0giGQ7uw4P7roDlTgIgUC4pLZpSYOg+8cFIzU0TLvGjnh/zM3DlHG40+b2cdCs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGS/OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+HQ/9EcEGlOevKlGAIfy4E/O2cKXIyjXfGBelDkS2TIbH47v5nymD\r\n45qpQM1/O0NghETrQOpXx/wk6xUcZx4U+ehUEAGWI/BlX3GnEqyWVPsP8PCU\r\nOhHwDlQAp+WQ1y9+s2Mz9azHVnuO6fBne/0ryJ6xuz1aIWSdG0OKuUV7ttMq\r\nP7vD9kRShsdKSy8fvD1tZB/XsbxxTdIY5xxHv9hRs+achgbuCsaqthXRUZiN\r\n79yM4E3O6U92i35ALxEIoJtW+LfQriRopJYkMMTJxrx54T/WIT6zIVcYAZMP\r\nlqAI8pfvgMGIkRjkVGPPsMzGKfkksIOjloeXmXWZkKgMIGgy3YfBps8+MUzQ\r\nzFrYOYLthPoRxT03yKHrdUgaLmB642wJn6CU3oasfmpyzkFeN+o6HUcdkucC\r\nKnBmzkIJRIJHLdZj/hSAYYMMrR5X2xsZV28CDMlmpFW2tQUQ614hhg5G/Mq2\r\nf3E40+jGa8+Mf3WNnZDiWIwzYJ8KFNFA6lX8btG0ztmHWrAnsscR7W7IZtVs\r\nPE/+vRZdj6a7SWh1+gMRvxyKf0M/Nirx5WQvBBFK1GcRtCUCc3MxgNzYR7Uo\r\nfawZsVgjq+jM9xt4KuG/6fPdojyH8AsXfu7DUi082BRMQE1DPJuE6eJjCf7K\r\nn4SfJHjWf50jqg2zMZYSXd58V1V/gQv5gdc=\r\n=Rja2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"47ba4276f021e8f933b1fdcc1385450e53412d80","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.31"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.31_1662595022303_0.14294381434192127","host":"s3://npm-registry-packages"}},"0.15.0-beta.4670":{"name":"piral-pwa","version":"0.15.0-beta.4670","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4670","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2db46c317b149a54567ba6c41665cd52c65fbf8f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4670.tgz","fileCount":40,"integrity":"sha512-nS6WeSBuG7182o9R2RIIhOXH/trSQLkJA83u7tanmCx7Hut8C1Ct3fMJTv7LQFyQVOW8UlPXdWoX7DPunJ497A==","signatures":[{"sig":"MEQCIHCmm546cp2X3FQao1M0jRO2eO2lDM7xAY9Ss78ifxBOAiBwlov7zi0X2WOgmfMxQteK0TCNW5i+U8UfWf5FN4dtog==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKkAFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQ6Q//Qw1jaUx6hXhrkC6cX9SmDx1u8U8brwOLPi3LQZlb89Pnt1lK\r\nDPSYM4HIUTceFv4rCogm7RNkr5vOPQgIasKvf+W4hwfNrcPuo+CMiYKKOLko\r\naOlPnJofPcvPOqX9jM+qfw7kjch2gfP46DEgSvJ0j8v4mTk1LHdBcYR5ORIC\r\nDPsiDaitx38hYwQ++9nGwraQyex34RbzvL+yWAqBAbSdpZt4f4gUUL+WiDvg\r\nbarCALYgVBMHjrWDHXgiBQwcEf1bNfaLJfSMlop4d2O57n5S71HuQ3RFhGhG\r\nmheSlE4HF/2d5USlOtnu13PjLqIvdeXH+i/yE1f1r0N/6BbID7E34HJVZJc/\r\nv6Mtn4A/8pAEaAVBs7qDUwdDZ4b6+yk3ouA0AkK9pOvgMdpCKHbHsFDwudOX\r\nLN5hJGVBLQ3kJC4e8SjWdkkgilQNgupRduOvNESx79to/hgjSq2xp+gi3Aka\r\nY+V9GfNzaTwaoVywua30wuHBUuoBLFbU9UTFZacIn8O7pIJbK0CzCWuyPN8T\r\n5HGfVLnYwALFNtEUDZISznPT8gu92aQ8AYJYguGoHr1mCa6/Cs0FS1YRTEMl\r\nb2Q8OiUASZ7YEBXNOnUrYOCHNrBgs74SU7jmQQawumdW9RChk//v7d5xpYOH\r\ni0D2/6BGSsifoX7csV3a6B/GBAvuknTavuY=\r\n=oA6r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"ffd8707600e028a55258028d394b76fe3a0cd175","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4670"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4670_1663713285072_0.7975216117600998","host":"s3://npm-registry-packages"}},"0.15.0-beta.4672":{"name":"piral-pwa","version":"0.15.0-beta.4672","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4672","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"899564becfa648264fbe9045c09f2d2642b0c639","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4672.tgz","fileCount":40,"integrity":"sha512-J0AgZV631sF9fPL0sLUlZ643TQEMtfsZMaoOFHROULz6bzyIhs0dZo14Gd06jTdSHiyH+8DRvkm9N55hvG6xjQ==","signatures":[{"sig":"MEUCIQCN1Tjh4ufbRyqHTP/ReAyMIeuccJ3XFKjbluuVLtJY/wIgaEv4iDV6WrsL0GXWkwxu2HJs0Wlx9j3Pa3kCy5kmsi8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjK5OUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXExAAjpK/DVA8QTw6TXPvO1kh6YzvW0WGp6fDQnIwRQvBa13fFWIF\r\nJOGcvn8lDGDI+Iu3xekOCR3W9SfeJ3+ckq+vbsSz0+auADRrt5MhIEJWxq/P\r\n5u8FhCSlIwp/I/lDfgH/QtukJciAqnpsRsiPCPoQSxlrkAnViRH9fQa3dAY+\r\n8LHH67u9XIN86ny9rbDHFImWzdrUI0j9l0o0oRgkU6KYdmv3KRMS5oto0LYU\r\nnHKHarHok+igW45oJZGwGBEQ4iyX2wHZs0/5ommXR4y8TCRCSyIVN05wZ59/\r\nyeAqbP2JfLlUsOa/1PAJFG+jaBRSjunEXuIG9XQ1P8MR7Zd9IFDnNV6+nBCa\r\nKArQUYMSXFwWrALlnj2+qCmPX18WT2OMP+cLACHd0PfcyDA2DatRQakJb36m\r\nblJZkorEyrat4UIA98iwltZjZsvwClw/icaGa8aJ3OJoZ8W6pgoe65ox2VWN\r\nAHY83RcBg5pPiY/zm63oz9yO91xIQoU43UgVh+azKvHNMb2hPR2FFh8tAfKw\r\nB5bTBQtzrjFK4Vzf3rGk/YLuedwRgVbCgyfACnAjl+OwW0k50zm+a3tRPRur\r\nYyBtXTCp+CxtRqQLjCNDMNoGpo7dB388f0lxgV9dazNNbIIK3j7W4ov3I1JK\r\nYkXHhiBo5Rm9IWX/XlxPeEy2rGc3vQm0DVk=\r\n=nBOw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"cd1026b70c90290fa5ba3f9b86c038eb852595be","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4672"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4672_1663800211834_0.2356315365051851","host":"s3://npm-registry-packages"}},"0.14.32":{"name":"piral-pwa","version":"0.14.32","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.14.32","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c28991483cb21496855bae7840a87d74d7a99329","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.14.32.tgz","fileCount":40,"integrity":"sha512-pZjyltAIWWWX4a9sT5BBLitKuxzRTRON5RCMXo2h+HhOvAeLrfu+kkfVr/6uIqeARgxECQ5SlUAnXb2ZBVFuew==","signatures":[{"sig":"MEYCIQDN9NPZY7+Bw5HdmgDKwjcMJ9hxyZe2zbMTcF/oF4keLgIhAIGbYRpZOQUSmL2HXqFTr2FfptNM/WOpRJMoHWCF8oT4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjK5oSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDJA//QjUtlm8WzLnwjZN7uxUBWu8spTgtxcr4GyfgukAMR6LMeR9B\r\nN4XtspLL6SfnkEtInCpnnEdjbqWLMSh+3r1dbaRNiNuEspIn7HoOLOIJyW++\r\nGGKERhL54ryMId3JuRZDc/d524+mB601x/mfY7XMOf7FuR5Q5GW4Fp5gPNTx\r\n3zgbGkuyrjclfrdCrKkU1ugJqlTAkX0rhumSLMHlOrSfzmPilUYQa46LyaWG\r\nRq9BBH3g4xVmfPzS2a933/nUx0sHfWO180P9j0qO5BQEe7HbwurLnJs6w5eL\r\npBMulOa3WFZ/IyQma987jmFDzR1lF9QwNluKTKmWc+SsRTfKtidvP0jIQ/cB\r\nF4A27ssBqohYP5pjb3JMQ9ZwWpTLn/G9X/lpDKrI+OQY6/3utkptMyjk90RL\r\nWmg2QnvX0VOC65D+caeCnAH4h6re4/yEW49cgVY1zrDiW39xon/9KycCPf27\r\ncj6r56ehVqvrBqnI4wUlbH2Lnt34Y589MdpjTMt5FL13o4GXAbaN2flT8XU3\r\n5SR4nYVHdjqDXJ3u3jHOXE9EvWNrS3h4jqLYZlkKvB42F+77YoO31EK5Wv0H\r\nUHC46j0smfuwMI7vuOqkXTcx1eN/n67cpxjYUnm75ygQoLn9MMb6SqvdzIxb\r\nWGzI097P5CyXltRrvUE/wEw5HhLvdl0CbRY=\r\n=yz12\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"8a27552a2ad6150e58d6d841937538b8158afc4b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.14.32"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.14.32_1663801874203_0.525072666788108","host":"s3://npm-registry-packages"}},"0.15.0-beta.4696":{"name":"piral-pwa","version":"0.15.0-beta.4696","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4696","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e996463393c13b71c2c884f9e70e5ec75d456795","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4696.tgz","fileCount":40,"integrity":"sha512-3o/2vZ2PhzAs7JHsws2Gw7R2UCUjrxYQnGCF7/vDBuPXOVb16K1je0HosAwk9EOhJIHQ758C/BDgn9nH7f8tcw==","signatures":[{"sig":"MEQCICeoiwN9aUf8i1LeNFheWwr7xOBpRErDK3QN5DzOoDseAiAsNpE5nFN8eybXpJphgtyg0cCr8oSklzTxlUmCliT4UQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNbrbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpisw//YTcweRk7NPA4j0JTc6D91h40iatV0WJi6jEvNdrrZOHAwKuf\r\nvYzDqn1UOR+fPzV37Iv3T3d3SvHT2FUfW3pvf5X1m6AW/4UjxBRyQ58G4we5\r\nvrletHbugtjXfsaHr52WETXr4j3o3Td8rTvVx6+BK82uJVrFKvHPKn1IzMss\r\noHOr5gM5MzA3lYWfrHxu8+gV9v4NrSx3riBz+tWhAOjyssIscEX4+ikfIHaN\r\n1nw9i1N7QRLkNnd6mrPsCkW1nFEkFF1gOg3oP1St1x8TlJBNB4KCY2VfbaZA\r\n8gOx2hQ+In5J9OQ2igp98t0QqYDNv3+XGzYX1lPFovHd5xxJvVcATJPwb8S4\r\nRuCWOiAaAC44g1+Lrrc54ADyBoLqYkwg0U//g9E8nIGM0wf1aDDLiJxqbanJ\r\nenFP14h4MldEDCfXiRKzv25+szHWhlfabNxce9J22/he39D8x8JhJ6FeOV5G\r\nsAi95ZbKsPYP2AiC0TRzECv1EhJdiBraVjCuOS+GPh9oveTxLCi0p1k3geED\r\nwiB6LDhOQ69E5LGZN/j0pxPp54LMOa6ROmfnX7ry4BvJvmjiUZ+5CUxe3uDF\r\nRSnxUIowEH5Jg/RmGk/K6wcd5/aghNaOK4eo7SkH9caG9Et9bE/yU/1JpyiH\r\nBsIPxLp0XtIxDbWdGs8K8rEKNo4GMxeUiVI=\r\n=Uqyh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"65701e0e33084e0c5a127f735bd3897019bfa7b7","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4696"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4696_1664465626894_0.5076039458845203","host":"s3://npm-registry-packages"}},"0.15.0-beta.4699":{"name":"piral-pwa","version":"0.15.0-beta.4699","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4699","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5312d4f4c218282148bcd3beb8e013f1510c87b9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4699.tgz","fileCount":40,"integrity":"sha512-YwCLNN/ZzXzfgtg8szUcb0noczmqeD0TbORtCWNpydeBdrVz0WByrM1ij10PsV2tigae9oXAygaBm+27g27s7A==","signatures":[{"sig":"MEYCIQCM91o5zyPZt8UzMtefg0Fhdyp78ATLywbkYnaKY7wtqQIhAPFwKA83Up34/wFA874VrasRTRzuvjU9cEIkzpjVpxwH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjONIkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmovsw//Znr9q8L9weZCQNYEgz5FkbmxIpkyJ9/9Yu958T5pEWSDo50F\r\np7oCO85v/ve/qPpCyDvndWd6gt3SaqCG3IP3mBMIFD+gxoAstJv50k/KRny2\r\n1e40ZoHsUVsr6iWKaiyl5obpvTPkbVzNJGuHT/0xNcn/iMZHaEKnj50Lr/Gn\r\nplFX5upaX/dVnyYcrqgAdNnasO3FKSSlnpRRQ1V3TORwxH0r0oNgnuhgXhA9\r\nQ7FfYkAjj+VZlt1LdbywINrECt5RDg1IzZpQQTLmogdPGc4N3D3CuhOg3obJ\r\ndFygUYY7CQLJ/hx2Z58o58H2ZcKZw5cftzp35Xo23MuUQnWJetdabK9sFj+d\r\nkCael4C0xK1GKExZdw35baLmwH59jcqDM2sskDmT0sdpnz+96pKwNXhaIACV\r\nwczIU95Gk9hFuCNpGiFmK0EU4/+w/Yk+11r4XWo8DTe5INC6O8HUiAnyheJD\r\nrK70UgL9i7c8St+itkO1qy0B3XPMTQtcgBDFM3UvDCWzHn3lwfHcbpg+rgug\r\nMt+3G0diKe97kMgm1WA6x7oC8izCzfQDPnQI4NRsUEfoAvlsmASP4GIvT/gf\r\nlp2b5Ul+cV1W18GnnONX4eHUQnLz2MMJNoRCGh8IFVnIDKUpI88Z2vdksyK4\r\nAykBJ2pQXQU2wbEjL3GFUfv2VLmi2GXsvvU=\r\n=VMSF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"1d7d09c7a953009ade1470abf74b5e7e627f2bc2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4699"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4699_1664668196416_0.2763357097681365","host":"s3://npm-registry-packages"}},"0.15.0-beta.4708":{"name":"piral-pwa","version":"0.15.0-beta.4708","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4708","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3fe38c3323e77a5881f94919bab3a7d12f88faee","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4708.tgz","fileCount":40,"integrity":"sha512-Qp5Fu01nJTA8Di4WAjhAVm3bRBgt2O5mziyIl12dxxlylYOPTzcbydd5azHUTw8eRaU8UEwTt8MnfB5ypd+4vg==","signatures":[{"sig":"MEYCIQDqNDFBbkN9xQyVELbbwMGFrSTgPAT1UCSPQebP8WoL0AIhAN0X6zNxK7sV6aMU2MttCOogkPBVtswtM/ZZKr8px/Ws","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOgceACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcqBAAjYWbpwOduOqc/2RSeTmz+i5ETES1bGRLTtDs6X6DV01jr3K9\r\ngnVU6j45FcHLx8WnMtwDy50y56sY5hNoK+Ni4v8XM6Ra+HA5xJHMjBytz+jp\r\nIhS1NV74bTamCxXEAgdodKbmiyUdQeNS9hg6taeX+nw26lKC5PALzJnQAG8Y\r\niWnCyxDsr68J2/5MB7P1W1Joxgsh1jwGu9PjM0FaSfAZ0XhlFA4CzRsPsHZo\r\nN1HQJLxMqTmNee6Ykl7UqE2bk73HR+LF9uiNCsf/Z2XVPACOE9hznrRV3RvI\r\nkA23ycN1DxQfvjgu2YFybcCGFi8oY19ttQeqhBMIORsUyd81+NlXME4cGC5b\r\n7C47Q3T0VGART3+WXOnIboFMsfGn9UajxKW1GODCMvRrJOdM5YPVK7+KEPjV\r\nK7AVy7b6iZvJYsSYWkVJjnZDfgyW1tjJrw2N4/rvBjCsqzt5dQztDsrgLayz\r\nSjCoTBdA6BkTO8zhHTS4qoRou0nIDn5h5DzKExmVcHzHt41PkP15EM8wbMg0\r\nE2Q8fFML+eunjTa9Bp8ZYUb9B305lwHDoom+Bn8l+JZy3PJCzbBuxApSAcS2\r\nivfvZMSn3Qo7zWcphEJzm+C5aKWWT9zoWvOW+0WurV2ipdPWSJy8WGMr9CiU\r\n4DweM3R8MpwR4GDBOkM+cSOS4Ow2LKvTlVc=\r\n=PQ7l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"c0d9ed70f3a5ff7cf9bdebae379f30af361914c3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4708"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4708_1664747294630_0.7569476364279775","host":"s3://npm-registry-packages"}},"0.15.0-beta.4715":{"name":"piral-pwa","version":"0.15.0-beta.4715","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4715","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8a100c31649a02c3c8e230b61b1952d0f16e7775","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4715.tgz","fileCount":40,"integrity":"sha512-Z28LOBaBjHhXrSoao+oUWpa7WyVHpudJ+IpJWHLeNy5vudSZ9t4LhUhoknzmFix7u/+yZKYjb3y7UnjnDB7FeA==","signatures":[{"sig":"MEYCIQDmz52tpS9lQRVItx500YkHdIavJguBsdOLUwMLOgc+6wIhALeh8OBKCIoFLwSa26EjySJjGk9dNkhW7NyP1JqePAqt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjOzFoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrYg/+OqC8EHpx0HHMwsCXwDTj3hqKBDGCBS3lv+IL0uWCIJbleHm+\r\nWS/gn4RNgVdK9JLEf72jIzMENPfUw6IVfD3eeAYBL69hsGBE7tgqlsdSAeif\r\nRHQqf0VkfF0qHTEtIEvMfyn+vWrk94N300uE0kpq7MFjcDIEAEXAEhGIcYWJ\r\nnTjkrN90H5qWM8/jkVUtwbsAOJ6Mpe2tjgMyfjJ/fY9FFgWg/1gpe7r/CW/r\r\nZeQoPdZ9EKVcIgCQWW/tnuJdI0tRsrpw0wgUlBuvT+0vgqq8qhZswqZCkcOK\r\nu9qwj43ixq448czY8lPyP5QdV/7yTs/coMZslrKbsBixt/Wenx/0DTAQMfpR\r\nO7XmwGoDcS8hkovHFvKwsHE68LGilWw8kUcQqk95BlbY2UtZmw8FlbA5w2Mu\r\nojjcyJQ5NklvmUdGmggzWRMGe4KHCqnNveGykEZWKQsEfZm9MazyK4cY82s9\r\ntRJAoawg6vGarTyf8hHh12SCnicUkmTwNa34uoP9cJXrdE4zF02yh1AMec/K\r\nEILpraei2YTKTBajWQkmjtl2hsnoQf9JN0gT7p48QLrRvt+1IygVInCjFLU1\r\n01GUThTgq7IGK64bx3m+x+QFRrRcSFMLGrxtXDC0ZBIwsUbShy32wQhOCXH+\r\nQdc6TUzyYmd01Xay4khLfPNSI5OktsQpIrw=\r\n=bXWQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"d60f35a862f4f4d452a504fae843c60d083a88f4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4715"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4715_1664823656040_0.49716309183497565","host":"s3://npm-registry-packages"}},"0.15.0-beta.4725":{"name":"piral-pwa","version":"0.15.0-beta.4725","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4725","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"d3d1107150b4cad80a3222d3193ac627ba7d6feb","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4725.tgz","fileCount":40,"integrity":"sha512-UmgBz7tOnmnnODBzk9c7hhFUTf2Q/dQpUhE/kjinB3hg86RmhcFyYumyNTvzhXSklM0qA+QMte+XT1XZjEsKCg==","signatures":[{"sig":"MEUCIQDvEgzw25oXr40dvN+f4EOagE088UkUkHEM72EkRemt6QIgfKuMF70rR+96kObXfD8/Sz02AWDxOcbY6V56giGELUA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPII+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXcA/+PNuEk3932tzki39rXAHJdAMP7aJ+YOOTOkYtamkf0+AJ8BZn\r\nd8kLxVt5POIqUFA+14RBrUVKZKD8HPllIzzYSn8LFH2D7Ars0GhMOrYpQwaU\r\nn4FurJWAf1/Hg6sB8hWE73q+lzBJUgLMyQVzNSfkAEqhae0eA9Oi0/3puO6T\r\nNFwOW8dYs2x3NfyPPlqcUVK+9r3xE5EJoDQfnq9MWOJ+jO8gMvT7/ecFmIsg\r\nRgjseosi6tXJ93RAYDRyPAdr5H/LtsBY8JadW71G+/74DjrT836T1ASvyJQ5\r\nUOyNl2dTn+LCYmQt3Ci/ilAEeRwYvown6+WXQwYK7SrQRJoQKxVR6oVPhe91\r\nS2WUAF0PT3ghymGd77SED/PvHlbGpVU2hNWJPDtoHx6Zadnfa9SNiRj44JC5\r\n9heAKMdK7QZMgNvXfV1fG7Zq91RFTQfLMtWdzw62z18aQHWlsUZo+e8pzK8+\r\nVCun+83O1EuMfLxLoIUIwcrJDzNw/GZdXnP3nndO6FlLc4mm5bjX+Xq1hXIz\r\n7a9f+Bw9OQfU59Ngz5MQcX6y6J7bPlkRqpZNtN5h3cEZZpdrDBZkts0RhT/V\r\nP2g/20YtO49xbTdyCYQeBSAHlwPxHLdpVUago2wBU25O8a2n4gFbNxNjnhcT\r\nxXsz9bGhwiuJM5buI0g+ffkCGvRvB27UtP4=\r\n=ib3Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"75f9470ac248fe45f806bd16b2adabde86b48e8f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4725"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4725_1664909886482_0.4824274088195033","host":"s3://npm-registry-packages"}},"0.15.0-beta.4739":{"name":"piral-pwa","version":"0.15.0-beta.4739","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4739","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bf3be96d5ea5492fda251c9ab762fd8386512e19","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4739.tgz","fileCount":40,"integrity":"sha512-/qS+sKl5fzzz1Vq3mLv/KMjJ8yyWLR1FIySXCKz4xcIPf+Iy4cB1yewkdbcwSlJQhsLNLpsAL2fkI2U8x75r2Q==","signatures":[{"sig":"MEUCICc0tD2FLy2/xfsrqtCRRtZj6G4kIhumzKILjPDpIvYWAiEA2KJqK6l6EktQKv/NM2cDuyjofKrwY1nzC1xtliVzpQ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQpoyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQ4xAAiHgaZvrrJVyxPTyi1x5MUaLRbTScF1Ecpl/zXMJvAsfndTTv\r\nZIrrKGJiGP8j+DMVMYkLR4YAnqRlTGMNFnhoZYO4l4ciPwWPv+PtEpHt9wmp\r\ncx2f9pVxapWn9+toyf+VGYj9EGOichqxeZqKIqtA+kz1Dwlpt8PKkECPXl3p\r\nf544e1PK3uewRs9kVxyzQL1ckUjYplM8W8Phog9vV4YmJnwukZ35cW6SthEY\r\nOM4wC9aYkhUy1qXcYfsyZddagqHqESUd2eJNbFDOOjBBvLCRnMaersGFBWqp\r\n7sMASlEPaJqRthi8zqoduNlee6o86wCEepD2DZB0BpDDLuhtE6F7JCEfQKpW\r\n6VmAXfe4reBm9MN6nV6YOtM7OCVsJypB0RzwQ/7HDm6m5I3cYIU8T/vIdsAv\r\nWTAA1iu1wIre0kam3uqeCHNE7WmyQcJFEmgslkYgTE5oCpSOHDcVRzFLrA3u\r\n8OZQKoyW9x2DISQkq62+IM2FILBasHpHCc/K+Delx4QJx5oG16flljFTmBIi\r\nzpOgedEZUkSZ6+KSDgvq725c4YtdGhw8Q9nO7F3Uz+XMsFBe3wL9OS5fDpxO\r\nWruO4e3QTSYZhMpYO55dM9Y9+G2VcJlWtt9NaXNGy3CiIZcmOIqrJ8vasnJC\r\nX1QZRZN/ikfLSlYbOV3+mG25NOBQDeMxqfI=\r\n=Q/xX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"6e7b1a13a5178d9123a80e44bc59d52a7310e41f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4739"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4739_1665309234475_0.9424266754567041","host":"s3://npm-registry-packages"}},"0.15.0-beta.4751":{"name":"piral-pwa","version":"0.15.0-beta.4751","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4751","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5e702c81bd36abdbed51ba84997d5cba1c7b6d84","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4751.tgz","fileCount":40,"integrity":"sha512-EDSsy2qwOdGZlVxaLtRjkSlMyaEdVj2Kli1Gb7cngEq6Ywc5y3EhQwPXMngP2D2bf6ZH3BHN7j3DMF3Cr+FtpA==","signatures":[{"sig":"MEYCIQDgXa5rKbgGK3uoZZ93d41Iyot972ZpJrMat4N596qqlAIhAJhu/gSzkBtGRZxHXJti0ihQeucEddn86AfwDAlbP5hK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSsCSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHIQ//c7qYr86E0svP1CYGkBFeb1nMFK5auYpqBgwYSOLpg+2jM30c\r\nWqiNQii4keLTRM7PzCMisLk/swAKXLQUH8emp15M5ARCJVKnFW2OHTcw8ICz\r\nsASGB1U2VvA64daAOew2lafYnPQ0VEbD1p++uKBsUNZdlCKiT6OTpbc5fiBe\r\n2sUE+AUQzZPL+Z0fvsbtUaA00xSBOSWrQAzZPj8PIWNM+3IjSCdPHqatYajP\r\nw1GD7lfBOsOSOhmWlI44fyR/caaNgwRDCdvarqLuS8rqdCwPLPluejpE/yEz\r\no2O+Ev8khTOxsSVzIbG/yNu3LdpDVR3no059xcSueVmDcgHw4wZOUTeNvNnX\r\ni+pOCLjswaIYRvsuFn8i1JtcSBSeLyP74+8hbeE0y2G91bi7Yk/vNMwEelhV\r\nurWdf2I/dTwG80hNLQa3UlRH3dsjs+rGhv1eJETW6EN1S6pWY13qWy4ygShx\r\n9Jl34wCJIrQ2osIBjylE2Iqpok6srl/+bQZnDqX9UP9f16cNsdf/V5aTsT/e\r\nMYxJyMFaKZf8f2wHWJ2t6yM1LWmXmWsDVGHLYORVB9V3Vcm8U8ovxQgQPmw7\r\n9SGAuarJfRj35K/zpeyDPrAX21jWcreDxRh7Sj6hQVWDwg2e4JKp2gm1VHyK\r\n2GUDSEPc101bnJcoc73mxm7cOAGZyhdmapY=\r\n=2tCt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"b919766c22a76e2e815815d8becf645e45a1aa96","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/5.5.0/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4751"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4751_1665843346674_0.18137271974677116","host":"s3://npm-registry-packages"}},"0.15.0-beta.4756":{"name":"piral-pwa","version":"0.15.0-beta.4756","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4756","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bd15d65f443bbee1fccef88c953a1d1ae3ce8543","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4756.tgz","fileCount":40,"integrity":"sha512-IRm3d1lTHpkuHtUP1GR8ZA48aLPrTBQgNLJSHiwTXphEOTYtMvWSYGq4A5bmYGcJnO5mrmfidX3FxeerclR+Qg==","signatures":[{"sig":"MEQCIAvZ1MScRkP2GjUoQtPzChIWiG2/BIJC8gUfAD4klV3vAiBkYpjVI1tn72tRhWyAHcbF10IJqjy4bytHLTsrDJRxGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUI16ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp21Q/9GIbNVEmpd7bOxhmSGVtGFbg4G4/EV2gFM5frJxQsLkDTrm3K\r\nKz6aCBacVWrxJ3xrLgKd1R6WlhLtYds9alIUoFIdj40o6TlLNQHS419A6QqL\r\n2biOS4jyLziR87HZQJ526ntv/VT/vh2aM7X20huEXYEKBpCWwy3M/3C524JH\r\n5mrUd2SAXL2+qubWsQy0rFPFQgjucHGWpxVGc4Bk9uSZRQjC8TDWL4M31vVa\r\nuRV4K9/SAKsK419wdK9RoAULpwvzlfwa1q53xGUnrIE6jzG4U1UpHUv8nklC\r\n0hCok1hFGXWi/k5BmRCQGa9hDVtM9fruXQH4d5hZ7QI0luXvaQgavwseCc9C\r\ngOSKYjcsIddGEx+IhWOeaVX0QSREzpQs+10k5ZAJlsjbEfddgvw/gj7LEKit\r\nBtBFsf7j2Fl1Bvwr6SeLr6j2USYpRgmOD++9uryuQ6kW+/4X8zZO32Wtrah8\r\nzA/3FsiSHBhRkA6MgXHHOW4I9Lnp07jELiK9eGBHvWzK5tIViH3iQ6gD8oCd\r\nODs9T4cv10iZbOdZ3DTXAehfshfWLT/5qvfxHQiluWgSR7lJwxdSgi3dh+rv\r\n1CKl5WfhZMTuDrkGUYe2EBIyg5sTpm+ZCzQ365Ca0hzCivtpa3MdT0n1pnBz\r\n/37kVWaT4x8fWChx275h3dCfeK+/zMa/Vds=\r\n=OGHg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"ef910b00c2fca5f4df24f6e370bfda8e2ab7822e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4756"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4756_1666223482526_0.08132393792389503","host":"s3://npm-registry-packages"}},"0.15.0-beta.4790":{"name":"piral-pwa","version":"0.15.0-beta.4790","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4790","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"453ba211cca1e2a0b6df6c0e8ee205e40177587a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4790.tgz","fileCount":40,"integrity":"sha512-8wp1UvWRodg7NceT6q788ReT8tM4w+MiN1MS3N3FI+7h7whlG5S5qDPH1AJTLiJ9NMc6vTEQ7P/axigAMK1Jdg==","signatures":[{"sig":"MEQCICqLaDzCXMYrB95ia3EUXCdfdEJtdMKVWy5Hk3gCqqF+AiBdBHitVvl+hhQC2saawO8FUBKWqa5oolae7TdJfuG4QA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjV/uZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAIA/+MHEpOcAy1A23iRlea7ACmoZXSiH3pFyUcOpa3vHbZdkFwdwE\r\nvETr5ROkIJS69n7Ag6HieBMnWdxonSbCNESHwuwf08woQbkktoJ14VpGILWh\r\nFF+BiGKAnIgH4iCzbMV3k9z60LUm8nZNkE/GsaFBB6g2S1gt/cCvMZ+mfiQR\r\nhxZTSyhSWmjSHQnUDDGcsCgOZZSyFtmccTmwp/byu66E/WJJt9x294U2JUEM\r\nev45TNGH1koCxnX9lTVLbX0xdx6i4TZ1g/eitxkSoIngu3P8gS+pvt4klodc\r\nCYRkDyJiduQ5UiArQMnMuwrITwmi5Zf7VdsgdZfqcGKsgvvveytCl5KTpuQJ\r\n11LhCufKLUkGS5zDOpSdYKjmlvV3ohwpMmiwvyFP53ZtTO2k6rpuWnZbwBU9\r\nIygCRTwExb3hkPtmdqHVplS5u8GL1TgNDEuQx+eZ3jvCCeUcOZIxRok0cb/r\r\n687tSB1lPEn8SnuGCytBVJRS2tJabFuN40apfUs2m/Iv30eAOfu01z0jvTRb\r\nvOM6c9LpaKMTOhHiffdC8QhySVGzQsB0h1Q8iWnlSdMyu4rPleVKBxFMPmAl\r\nb5/XaP7f2mA/R8Vagm9AiqsORuEBbnPCVOS2L7u3NGhZ3dmpIKqXSP1A0ebt\r\ntXDeo8DD98IVTMtjVMdpHSVhePGRJNl/OaQ=\r\n=yRLD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"610db60e98f53cd53a20aaf48f58b87e69e6abc9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4790"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4790_1666710425041_0.9042613154952333","host":"s3://npm-registry-packages"}},"0.15.0-beta.4791":{"name":"piral-pwa","version":"0.15.0-beta.4791","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4791","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2ef61a601db74e4d6b9734c0050cb7241b7d5839","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4791.tgz","fileCount":40,"integrity":"sha512-e1fjxL0KMMmVt9hekhadMMvveH0B1zRVQr92RS1Bvmvq/wNAcyRHcZhx6loeHc4q34nTkh0zR0HBxXkGeGnLmA==","signatures":[{"sig":"MEYCIQCY49guYhTL1JRP0Dw8f0y6YE0XJ4YNpRC/RnQYMHnu9AIhAIPUBw/uQtXolAli7nUSUGmmbuFhS7D+Of+JGx9N+0rl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWEpeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd+w/+MlqssiVEOKPpjIzdm0fak8ZI+r/hG7pwxzPWjCEfIEGVrhG7\r\nm8JPWKioUuzuNhaqqtSiD0efzhnABnHoL4jaVaLY8Kr1+hbbIQYPKEPeGl6+\r\nkKUYLNR0EYqRGA/pCQaPYwP8jue+7ju+0d3BQASRnCF6hA1JbHBhXQ1OLzC1\r\nWTeQQUIIF7XJSb0fPhh87TtSQZsfM1eC56aJHr7bIloAMOo3lGgfFjAXUW6l\r\nvDX5Sc57ngE5xMomqkiT3iN+DV8vGR1Oeq0Ij+K03zhYMfmlYt35ATL5GQ9p\r\nIFE3cJ3vh3k6TsgCDb/zZXBwdU/2Rvsxh1ZjV4DPqbF1tx3vYqL1S/QDf/bT\r\nbKP3igW20pK03rjYwLEHD2dPnC4nF2iKqOisw1TPVg67sBQSDJK4iXF1L4H4\r\noGSfAjwFvvXJKORS+y9pd9vda72sON6g6dQe2mGpLcu3nhtaBF/5iPhbA905\r\nWWFXnuBLtUDCexG947GWF7JHwFOGYCncFwhEAcofzs08ODbg0fCZIPrOrHKN\r\nkowcatMa3Qy/7gyjzBz+mdhJMv6B+Wc87XVCTYmiVC8nBOuRL2RCpzIxAGSC\r\nV2eGTIkcJQuOO6Kvv7wa45FsUJlZRJNm1BqSw4jkIxQEz5oUd3BGiygKh/Jo\r\nCug4kLS9APwHlpuh8nstTo0u9zvl8z4XoYU=\r\n=4o/X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"9acec0b945406f141dbb5b0db12760245f911bc6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4791"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4791_1666730589846_0.8738941013697541","host":"s3://npm-registry-packages"}},"0.15.0-beta.4798":{"name":"piral-pwa","version":"0.15.0-beta.4798","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4798","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4869eae70e3983a3f1b7299fdcda84bd3479c418","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4798.tgz","fileCount":40,"integrity":"sha512-TLI9loScW4nVEkpdqFMqOs2rbyGi49On9k1XxNoOUfuU1ZjHF1ZBt1jbQ0ps0xEUYdPc0VNi8SbU2JQ3JSr9MA==","signatures":[{"sig":"MEQCIHmrFHoMFDgl649HrL/7HVATu5YCmsn6WUyTHpeFynafAiB9A0JPW6RnugqEF40nrWm8bNwud/iqL4D5vDvExn/fjA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYY0hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptOQ/8DWijxHuGW0onepuUZPlPvqPVF70G8BDt8gjAM5Wnt0Pjxc2y\r\nRReUeKj12HP5ITOM2hT0aXcV4jPHfCIJ0Ikio3sj9cqLAuNBS1mj5qwNfEgF\r\n1pOKx0gLywqghktYe8kqA/SlVbcJNXn1+TDKAk1utFPRYFEjMduk3NHHzXzP\r\nblFwpOYRbH0M/rdYM4TWsM2ilbNyvxIy28iA13WEDu2MdJ+/MpejEwWrZoVq\r\nNQtHp9lWHSpQd2bnHnP7rGxGhVjJPJP3PTBdpdKtJDbBmNQxN7vqbRvAdT4q\r\ncsjtsv4XpFstTcg8+vnoOfvBtuPkYJ4Xjc0jpds18NmsYZwuwMbj6WEJ53fV\r\ndP+BPMGKSauHlFpmOHb7wY5ZoOdnidtPTFjCT+UU/nC46Qv0iFU+7QyCvBKM\r\n+fznIEq1QGeGVOFT/beTCIVZ+DkFH+65pEnj4rfbYAKiWH3+zlvSaGpv+18d\r\nbrrWZatr0On/UtyJ175RqX7sN/nacLxWNYcPBG/QWzVY++Sp2nU/AzPw8iYa\r\ns3yJv+hwU/+CMZGYTgx1xDVXFJsnys/1aJ/mBziO8KwVE/P6DlEF0oRkJGsP\r\nXtb0JaCkcdVLHrQOZqfdm9885en7P5H+igZaOh7PuINZPSlBGhxsPgcfpjYr\r\nFZq4W0zIK3X4yC0r39EuUh+AFozr5c8GcyQ=\r\n=BPx+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"ee715b27a48b4ec7bb69a761344f1eb2eb731494","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4798"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4798_1667337505498_0.9604612201647347","host":"s3://npm-registry-packages"}},"0.15.0-beta.4801":{"name":"piral-pwa","version":"0.15.0-beta.4801","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4801","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"280a479e9f6bedc1a0488a97feb34726a5830c2c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4801.tgz","fileCount":40,"integrity":"sha512-3n0qUpc/4gjCTgqNRpYxwEcPXS7LKsB142nAIh6lWc8HIfOq+Ujs/fR0iSQs6QL7Z5qta7Cw8ZGJx/qKQNv5qQ==","signatures":[{"sig":"MEYCIQDRhpkNC8OQm+gKJvAx4OnOUd1Q64gzp+i0FJIX0O2WZgIhAI/FE+iOsW0kTrY2T4s2vbP95X5DR87U7FE0V8hiR4jw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY8o1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqanRAAgYe+C7tVvaGQSE3ydtQZ3fnnFLbOcSMCSuNMiZ7xTlBpsDxW\r\n7NE04HDGsyZqHGFP6bxwGllUv4tduEzpaLqjN6Sn8mhCRgBMxL0MPhxrRrno\r\nh7c+pWc8hNSJoyMLzbO/d2akbIZ85u01elh2VitUTAXgbXAvHBqHswO3K2gM\r\n2yerGS9JCx/CDzmwSpHiFvaIb/MQyU/TDG+2bnSlTiOIs6d8Uffhq623pZ97\r\n+R2I1nHQBMoTS+1kJyNDBOke4mMFfTgpb6gH+7o81dEtNl9wDNRMcffdTMRO\r\nYde5+Wk6DzneKEsXyDQ0TAnQ/EfBAFuAB9alUlcA+Nc/OCYZbgxvOaDQ+2Hf\r\nvWG28M8H/I3d5XbsQntf2fLJRo0RdtmAbE+LhK6rJNmknOoZSImseHUPZq00\r\nfZ0MguJZgk85ZyPHa60F4oh/oDc2UTQBNZMZXO3WKDodxAOUhkW9eA5vqx7i\r\nQoPJZcMP8GO5PeyDa20XkA9TMc7izC1sWUDAgDdw3RWEvJMUAZ0UMEg7py0h\r\n7BSYqr+3LoyWTgt7WajUjRjgn+Wt4pkgGJN+EWpPtvVmpC6otaROIIzjSh85\r\nSZVjbt5gxatrOL5CVfSHgg7JN+yLayPFzclDitUX5v8jNGZaIsI5h2AIbqpp\r\n1haI+SnhCiIM53gAaIQJ7/W3hVb/wTGw+GI=\r\n=XqvY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"ba4acd10b46e8c233841863206f9fb2ccc8f1958","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4801"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4801_1667484213421_0.7072974960022154","host":"s3://npm-registry-packages"}},"0.15.0-beta.4803":{"name":"piral-pwa","version":"0.15.0-beta.4803","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4803","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5321dc7a7fca1d7451c2581f2ff16d927829a32b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4803.tgz","fileCount":40,"integrity":"sha512-X9Z1vOMJbehOgFpjA8J8i+jDDDBnHGFrBRA4vmPh7KEqWYabsvCvQJ9T91jwrUe1uKbesAWpEMLvQSLSk2eJNg==","signatures":[{"sig":"MEYCIQDnFMfzU9qbrzdtwRptjS5IyiuHSwBnTvE0lo8I7En37QIhALNkmvqsiBb1hCTz6RIzNL9srDUHmxMZoWo9r+O7NvmP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZcc+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2qw/6A6v8P1sej/4W5NMTB3l+GD7DbWt0+ZfiPsi3CzDIqS+JWyVx\r\nHVGhDoNKahjxLQN0IsA0FV44NN3V/gtcgXi+GxT/5zs+9j9sSi1AXm0chz1h\r\nbvPFHkD9swhlmMdlhwtoGKi7wGIT37HAE7SKuBimp2U6X0aXpt6cUv77lBSj\r\ntkz228cerXuCOEQ27mHVAyfFm9P9696I+GqjJbbGfhyFkn0xJSQuFz1DSwAy\r\n2OF7aougKp2pMnurvTzXdV7mpoLb75yWYfN9yykRF4XhKovh6zcjQV+LpGNG\r\n9RkngyE9UEjlHvC9v8TinBJ55hNYUQ/0PUiAVMU+aB6V3fIes0maCrPRmJIh\r\nyjrEp8qlqbRKwATaJWkarXq3K8VS+iIWObsoC2LqmzD/n7eOKjtANXKhFS5d\r\n80HSDZ5vJE/MG0vgZdnb6ywnhg49D6rnXUImKk2d3t3ZfKrD3Pw7CTFrZVVd\r\nU+SzvBH12tQRQH2WeWdPPCqj71BdO+SpN7kAO2Bvr5Wmm/9D+HzvhW5UHxQh\r\nPWzZow3eghYFW6APFc+xt1WlYb7s06KGGlpPefDXUrVm97+F0FlAWVuM3xT5\r\nR+gvtrsAHiCfuLe3GlFIcK9ft0ccmLqn93kcACbzFFCnIZHGD1loQEowvFpn\r\ni/Kp7eJ+K+iILr/UIIXX4xvrJZmqA5/Ct1Q=\r\n=l+w9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"38c4b5994e2235e20d6aa6d4b188d98a5cedf85c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4803"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4803_1667614526109_0.6236753497213507","host":"s3://npm-registry-packages"}},"0.15.0-beta.4808":{"name":"piral-pwa","version":"0.15.0-beta.4808","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4808","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8833a71c355b0d4328915b290dc148e5db1c5fde","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4808.tgz","fileCount":40,"integrity":"sha512-9ky1EhVPNg53zWMBuTPEBvoZ+7bRT8vnD5BQOhyuv0S7wUhWLXwAD4vLHjE6aNDEgnt8MspRNEnGHBWpUBiNyQ==","signatures":[{"sig":"MEYCIQC3arz2NvNlir/0PjpGH+HTWLAq6G3pJkLMnEtSBkRz6AIhAN14yuclmCSpuZw7o7l1JHLZhtXVYHQf0LFRO3cVMo5u","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja5RRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxNw//cHDX18YhHaZnJRkVMPNG16otlMqXXy4dXfBUPNA6tfXOJpDL\r\nREbqD/d2HTYrCYQY2m42QW/8cIZ9Wr53SCWLOluKYGgBcKm1J8gdoGLguFNB\r\nwXX25PQrcZiGJDP/4cDaENWW9lJNS74rpb4sAKBb9DTI+EyHBJbMTbuWLP3n\r\nU3Vka4VtXQo7cuBhNVAqw3ivpkfK2MIP4sw7jq8j/1jEF+ogYJo6XZFUg54T\r\n+y6h9/ofGRz1sUUuxkvB2POe3jMOKmWNJsRN2uv0eM4lYtmWlB/S0dmP6Xy/\r\nBBx0rz+4hsrGneDAkF32zU1BHirRIYZXN65NCOmZ/A9S906AsokN6qvZO+s2\r\nUhySPRRbWMVpqxI1QGYlSuk/ACOhbDokUw63muNtvqkpgOdzM9ulXMeRES8O\r\n62LktPZBph5CAD0y0ydaH9UH7r6dkO4y7r0EarJxru8/PfIFH80hAJjLc7Y6\r\n054g1OEAzndXWyIos187Npf7RcFZLn2ES6TvoBBuC51xrFgXg0Dlj1TdWJU3\r\nmrjjEDYf2f1ZOrf6CP7JARZL4tcDbGaj8UHDqz8RLffHwgTDvHj5R15HLHrh\r\nGOFNMJ1nrUpjTaCtyZMmbqr3oy9zimfi//QCsFJ5oZvN4SxUkVv3K/ST9kw8\r\n7Dv7qsxZNuNPH6PudCmeK6xRcU2+tAaLCDU=\r\n=sOw4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"27e68a7d947210860a3bc6025b6ab569ae2f69fc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4808"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4808_1667994705761_0.22272392399170138","host":"s3://npm-registry-packages"}},"0.15.0-beta.4812":{"name":"piral-pwa","version":"0.15.0-beta.4812","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4812","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5bcacf50dc3e7a6410a4da699bdf1ad6ac35a111","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4812.tgz","fileCount":40,"integrity":"sha512-2Y2pf4LxDfhpnqJ7ZqOP7EANU78vNZQc518qnkRFHbsmBTKoslm4sK8qpi7JR3DrVEH2Iy8YcwxyBNxMsJmczA==","signatures":[{"sig":"MEUCIQC78hBG6sbDGp4wry308ICDScfd0+xLWIiaM96nOSYSPwIgfSyH5grfaxgXDv7oLa/7vcrWSvnHpZq4htHntIHbyE0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcEVXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqaMw/8Cqizip4uhtoP7NGocdX422maH15iJBHse/VEIqklMfkylAUS\r\nnB8YqWaXEoCC5qTX27dXtGSOiZwQO9BzyXCoo2JA9OQ4nqkx6FQ9mP4VWuQE\r\nuV2RotuB9f4ValD9tBJCzFKcDmqUynJYEGK0EEdV9YfMbvHMG/NH8NMlp1LN\r\nkpKwMegLwAv07LxE6Xb41ALD394zJvtwEAp1oeZQyPWveKw9TH3SpHGOBOR9\r\nEBwPZ4S+2pNE1Bya92yQGYhL1E1nohM3hU5f5iBtnaiL8G2+w5CBbaCc13O/\r\nP4iLx9un7mvXWJcF46UqWU2X5lu7c7PHgpXteFHlKD+UOBvG2gRbVbjiVgIC\r\n3pGRPVEcYiyq3lybQirFKVdIs4x7+BwZTKdawI7i+W4QYqOOm1tGtqDI70k+\r\nEjf0AEbeGUqeDzNEbjdcW3BaPwGRSxjnSjxyfxS20LeA7khYOzBl2peqh/49\r\nm57wOvnXG/nsVudKIqqpg9N8LNaJIll0cde8uOGsHKlm8OpDJp8WitNxPXM3\r\nW5ZK1OGR1mMzA7gjMeTZPYGmTYgZVxL4s/E6h4dNnzbsoj9hPwvERuuGnMfL\r\ndsNFXabPwajn3MXY2BmBDPUh1dfS0+aiH6kSs//W0HHb+zjrsTazUgjIsY/a\r\nbFAMFoSoBWMKw73EcJyKkaqON/ES3qEGrtU=\r\n=o7BH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"96956ad19ce349b35acd7992979466f911d33156","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4812"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4812_1668302166876_0.7165991468129342","host":"s3://npm-registry-packages"}},"0.15.0-beta.4813":{"name":"piral-pwa","version":"0.15.0-beta.4813","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4813","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"318c76c73de84ad39a4334f882dc89464dec0df6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4813.tgz","fileCount":40,"integrity":"sha512-bvtEBp3Moct3eAVmSvByEVLSEa8xr22rNP7nEe8aa+0u2iwqGs3+l5/i2Xz7zxhoFDHJot02F5MA5wTV/RAXrA==","signatures":[{"sig":"MEUCIArBqNPCAglU2SlagUcETklFGL+O3T1gDr83sbaMS9y9AiEAqBrhmefn0gcNJzgciMCkvmSVPj/1n8UJ57v7DJ+imzI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcZCxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrO8Q/6AgCfQDEP6L0B7xq5URRshlUEgs72ApjIRkgz1Ipvk8wpwsIw\r\nxYHoAKS/HULmrNtgiriA6YdDmsIkZsNhog+adV+av4kjVTvsmR4isHnRUPaQ\r\nEE4zzq4pIYtrl0H+joEvsogOz4yqsQBDb7xSrmU0273luNnrq1CdAVXqFY+2\r\npnAPV20NNps7FY0OC8AJ3lpNjuD7ddmw5z7vhDK2j8LT+BqEjs5BSCqrOGLN\r\nk4kKKAFvoLjYClpQujmBedK0hp3QsNg5bERfGGcDMcjso98NDvEfjsanyMpL\r\nwY0kAewvgiO88vt8Yy7DDmrVaJoUBji+mSvLHjhTtrRMxGkygybYxc/ip4ZN\r\nK3d4NK00uAAKOJLbDkixHikR6FT+zAB7NNvds7LovilqVNQBuxqhChbfePpc\r\n9OYEYO6RuC/37lSo5LRdg0Ir8q8QSHWVKx7jh8jzKGQpwdHhzVMMCyeDNK5r\r\nc+rwkEGo3WKMeUCRFdUXcnxoBHYBhzO8ZOBZQwSgl0V07CaI9pi0gkB/zh61\r\nEsBjMOYqJxrs7TM4FT3y+BZbLXGwuoMc4GmQbbNT0cvmXlj7Bo8EDlvxDsWa\r\no+2N3xdQA7yV3n0MpnO3sfB9sSIGCj/g2H6jYCQthsknQaH4DsR/qwlYbp63\r\n92OzKJO2FFfkoqCcL1KcsTSBnhYAj8v5FRU=\r\n=f7ia\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"2790199e9c9e3792899f3325f0584d97af77e795","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4813"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4813_1668386993714_0.24340834338060202","host":"s3://npm-registry-packages"}},"0.15.0-beta.4815":{"name":"piral-pwa","version":"0.15.0-beta.4815","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4815","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8a0f62fe9a26e2cc22e78cd13d2e2b0609e484bc","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4815.tgz","fileCount":40,"integrity":"sha512-bJZdGoMnQyYj18+j6FRLQ6Knp/r9OVXOjxmkRHwiWxxRTOo8dXHxwjLZsq+AV6QUhxto3nEh77blSo3OmDi+5A==","signatures":[{"sig":"MEUCIQD7v64jqrVzKCzbTTY+j06J0qK729RFx9HGR+d823WMTwIgUgF6mysoBFUaiaZp8G8I4YqRclXCZKxgb9Cv8wt9zhY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjch8NACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphQA//eZEs4eIseQYKzT9IRdOawT0P/BVjB/lA7oaDOMW8iVnCotal\r\nD8sIimKU9r97wf0dzbLOw3ngXJJmQ3hJXu4z8vlTs5T5ImFJOFo6S1EyYFYB\r\nvQKS/JPhYM8bLKixCsLbcEdGPh4bR215J5VmMEyJFWjKx/BdYP8wlwIdtAEU\r\n1noYr2zp3w2zjSbVliZJLY6cE9e7RISbqSYH1I+YeHHpMA4QGH+FMPr8lLlb\r\nQz5hEUhsOp6w6OL8xmpEOfFpeGOwNdsr46xmghh6e4KzsSYas/puaJ6+5XHl\r\nEtxg8gtret9Tc7Mz0LGKpcIHwdEo9wy/nk1kKGTBh41xRwU4x81fweqcBj/t\r\npO+G6+Hxeqpra6Ktee4patAQEHK/tuWdoiRdT1hlfBLkW+YERXyfzMFHmbcl\r\ntDgryHhOguJO9AcgYfGUuVeRtNbAWaSDnpi7LK4P1yVzFmDJYn+DqxuwwFkZ\r\nxv+/mD1HG17+tJ/olAucyP58TsvjPrsnhbpwbT203RPbo++uiRNwm7FJ4V1n\r\nuG/9M/cgGEcBJUP+Hfa+e0tDW8X6oxmwH6NIDs1Mtsktgte+OsbWWHHvZ6EI\r\njQ0neTzaaGaFiqv/dSCAnuT7tPHn6DaWOCGsqLUPFApnErzyGez1NFZgt80P\r\nC6dmKr7KJpTQfFLWEV1+jUDbYYLVp8Pq7W0=\r\n=qvtY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"4942bf8aff67eca5fce289da420399421f0d27de","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4815"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4815_1668423437115_0.46873001751629384","host":"s3://npm-registry-packages"}},"0.15.0-beta.4816":{"name":"piral-pwa","version":"0.15.0-beta.4816","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4816","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e79e8fbfb283bef7b3648168eb09d8a78163686d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4816.tgz","fileCount":40,"integrity":"sha512-YGIWdKxoVGMn7OM6GWpdBeBzKLhVYsm5O6GAeLl4c3B0MGpObC/0Vc433gkgixQGa6HCOSaLZPb65biq7aK07g==","signatures":[{"sig":"MEQCIGo1HEzapX2LEilhsyRdiyIZSgH1Xnyb0Ho7zJhW1pPOAiBNCMUorpPgUcPD0UqlZ4+vUAFBxevlPtV5BpVoT+IxLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcqo8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqrkQ//WQxIkmuo7sgNJmxPvfuvtJenUMYyQMBZv82dIerk0NU6gehT\r\nAWBl8270a3AgGX3eqoxvXNGsf4UBzr78rNfiycy95Tu63i2sJJtkMvVmqxmO\r\nhFRhDIzQT62foK8GNpZQmyxgIEhkvWpkRNfqqqvrTosdpER1+tI0hFaVG2ch\r\nU6zI7AM5xGuy0jIxDoRMXEjRIIanCIzgRSybiJv5PgESfmyctCa7Dp+rI3PI\r\nWLN9Q0AcJeZTAv4qpe5FR+tzD/grq/7Twuc9vekueCTnIJZWzC0CU5dqpHiI\r\nXIaEvijAv+xHvz82YyoNNOJBeM0fc5FcuPM42sUl+eJZ6MI/p3SlwutSDIDy\r\nUJb1yk9OpR2kKzraPkyP9FCarCLtFWh9XCB9JP/yvR6I66qVmPZ1kmly3TUP\r\n7tyJ9TlB4/pxNJ4GtPTpflT24kd5DhUl7ASp8PJN00avFE7eGdklM6+FtP40\r\nHSlchaNi6Tk/CSwVFDFKGRgb+YYQ/HnowzlPh3q476/gEGo+uRciq24DbAsY\r\nQ8aKkwOXj7aHXNY/7HYAl3Aqiy9fb3d1ohiW7xoZDO5oCSy3SEn+pn9xQPPm\r\nb6QsIPB3MYisD5AfxryhBqFAtKAyydeiyzT3Tk8Bdvw9EUvtOSwpBaiNqObm\r\nFRg5+gfMHXqAOezIQzDDRSxzCaWv6/OS08w=\r\n=10m/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f6af0640e919d26b25a5dc51d6559c9201728ccd","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4816"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4816_1668459068014_0.10118804803277293","host":"s3://npm-registry-packages"}},"0.15.0-beta.4820":{"name":"piral-pwa","version":"0.15.0-beta.4820","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4820","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f29fca55d53f91c1032750b607d2d486225d83e2","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4820.tgz","fileCount":40,"integrity":"sha512-K2bw2QiPNrvVM9mnV3pgJaUk6fdu+LhHtf3VkuG3+nlb3ptkk+j/eUuvUi+AlEzRKuWc6v/M8U0SnTii3ZafWw==","signatures":[{"sig":"MEUCIHXft8lspjP2D5C9ZzgLp8BVvZvG4Rb6t4wekZxDCk3oAiEAmuzOmywV8iFfasUpuezkP5JydyIeyFWSb20gDkbZ6iM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdBSoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqG4g//QbEIs8uoGC/2RF6i7TTWnZhPVupd/83cDcZxEo4cyzU5unvf\r\npGUxzNyRmsrRFbNSQtjV8q/wSifSNbHmgHobagRhmVb2RINLwWRL7a91NVhH\r\nv4E7/Yt3B/I7sM5xjLxSNmoNLYpZOAgBQHqzo1myhfC5e9SKpYgo9CHYjv1D\r\nyy2lfP/zkg3sZrYaee1P0OqCB52RCYP+pKa/g5BV5HqmZyPyAefyEdp23OCC\r\nJ/Inrq5AsF4L1r0/4gh5WFmUw085MSDvEtJniK9Z7M+dgbES2E98Ge5E9Va7\r\n7cPMUFJLJhvXcB+SafOPXX8QTldkgbqZTwUm+I4bawyWv/Pi/RL+YSEGMk5o\r\n6uwIOgWpiOrGiz5MkxBtZ+1E4md7D6WAddXkxW+pwBZ+wIGCESEU79c6SMUj\r\n4TFvCD/ETgm9dCgEdYTdf6wmhPzb63vYYVyHPC/J9hxqBqCfTKAxcsOTNgQG\r\nfg/d6a1Z6Re5EAcP4g5k2QE2Maez17ahWAv8kiHXuSJh4YTvfcME1AhBaXyQ\r\nkIGOqoxAjzUoObrcdgHY4qudx33xsoNrHODYirpIN3SI+rvFjtTOKRhzWj0k\r\n/FrOljDFnYiFBbSrU51cjNNq9loT7J/ZcC4iSTCNwtbIKYM2qfSvst46VsFD\r\nGAzYG8FhPrO3YzDmB3c0d3GipPEsFK5EHmA=\r\n=iV4j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"2b5a24273c5893cb5573429396d8991d282268b8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4820"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4820_1668551848453_0.6332364635386682","host":"s3://npm-registry-packages"}},"0.15.0-beta.4828":{"name":"piral-pwa","version":"0.15.0-beta.4828","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4828","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9c8d1002000f35ce72729a60e4a9ade23ea337a5","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4828.tgz","fileCount":40,"integrity":"sha512-f8c9Zu+iRTl4HOjuskwCyETINK/7tZRa0ebU1BF8+N6wCEuGA/DMHw3sgFpB7FpSkWZijrkzFVlFfPYnlSiQaw==","signatures":[{"sig":"MEUCIBeJTLKAp6J4xQ8ZH7TwOgMBzlzFBIvubMcCb8lcPFV6AiEAi4ftOjefH4d3adRLhBv0B3z3KNVQWV7zscjjEjWD2NI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdRPKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoSJA/9GnUazk6/uPDdmKO6t75QKk34JfAIdmk2WvlTMmwMwY9fmaVf\r\np65AsS9pmo7vkT+vljIiKoNLVUr6/Jt8v8yViDtaRiJbBARskEAsbPEnil0Z\r\nSuWCmewpQqU68W6FbMs2edQcZl4m1gkWRYoCdSLGWUJY/qbAPu+AnzG3ddJ4\r\nR1pLd2pMLK4X32HhWb6Ph2T8hWaU+d9P01m7f+L3zOhi92TpKtZrNOZTGUcq\r\nK+qjKdSXERBZ7sfpFsrj1SABNxEW6Di8YFkT3xq5f+LZEuakeO1nv3jY2aGU\r\ngN2ez1zajtqu65cCbD9v9VOjDhQ7iflusrlXDRlC1RnOzJgcpFro7yjbVnqu\r\npCrdv4FEdwPMIiE00QuCzmeCK66WkxgK2glC8FGjU99LvOzRptsvC7sb3qHt\r\nnsER14Qz7RYJiC0qVZ73vFLODWNR23LsPrNwTul2HudOHth6NcjLO2m0JKgK\r\nOFHcV2LoX7c+RFMkLggxImLzCcr/QnFdjQ7e+zhdXixzFOXh+YiuNeLBaFQ7\r\n15ekRP1a31X7+KKS0lda3+rudmWOLZf372odr8quAizENnLSvjJ2Qk734W9z\r\nRUH+O4aJ8BQ/QzRoARtDFwMaakLZwn9DHMnwNKTEGDIo9IfwqyMRKk1KZtsY\r\nojR4jzOCTQa8Yi5yGTUYQsZwAB06cn3wGgw=\r\n=gmFr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"88be8e7bc38cdb48e6a8bbe20e14644ed790a2b4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4828"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4828_1668617161978_0.2474932763606421","host":"s3://npm-registry-packages"}},"0.15.0-beta.4830":{"name":"piral-pwa","version":"0.15.0-beta.4830","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0-beta.4830","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"440c435376fc380447fd51f94bc7721a839bfe65","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0-beta.4830.tgz","fileCount":40,"integrity":"sha512-KctEn/oes3QMo00AAdEzIHC/+Xzg5/y/SywzexkaAHJ6r3H4vbY8paI0mB0FaztW5mAn9Mxw6/CyfhpSV5EyTw==","signatures":[{"sig":"MEUCICt9moUDF7UIM+ZsgYRtOwIhmdmiDN/5wu1LJND5S6QKAiEAkvrEuhLVKYCCDwzKiBcKmBVAqfVCTb+PIZOWEVpSUHc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdSRfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoShxAAnbrT3mpCh5VaubSHZjr9LsKt1WvcurCAA6INvXcTY5+lTtuW\r\n2qVtz7+XN9RY9qU0ZB8Y5Lu7p+K5kbCWnEzmriwb0f6Zt4prdpyBEau6dSN8\r\nEr1TXqCwNAYrbqTewnYB8C0Mg7YMlGoqN6r8ZCFVIwQdH2icWqxASNdq0F9Y\r\nFgLMBzBOKRvzehtocfU1xTdc5447DJfz2Y++82trLsrLVMujPWRV37UWkt9U\r\nr0Dol8K9RJnQkPESXvmePRMzQfkmAQ0m8YzAdoinmeqzGOPSW1s/pTtnR4wK\r\nR4AYCc2Kyn/3DBKnfPBYsYvz6WUbOBv91hkOtLOZ4gDb//e+BcnKxGQtJbbr\r\nnUIHYiK1sQH0fp3IVY2n7LOl8GwD738zCz6JypdNTmBihfRRsySy3faJPAGi\r\n48TcKpLYuhgd0k3JCf3KvYS1JwnczDF+8d7f6nAff9kFhv0RckzcMkcLwkIo\r\neRwreqxmQJb5F8TiQ9+PyH179fn/aScEY3dlNIq7cDYipbNmktV/bLi2v/kD\r\nrNmiRkQ0WAzQSPo62bNx4T3k1mqdbgr9bbKotwWv33zJtPKnAtDIv+GeaWCF\r\nwjWUnMyun8/sAAYnQt4HUan3JJ5nMhHjGnJpWJtnZLctlEQivfMepcwEuebu\r\njulY+Zixz9rCErR/kgDN2zUeBh5sURrVn/Q=\r\n=PZ+M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"da4b488c09b90a28ae06be0bdef173b98a175f14","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.0-beta.4830"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0-beta.4830_1668621407554_0.6427523959441466","host":"s3://npm-registry-packages"}},"0.15.0":{"name":"piral-pwa","version":"0.15.0","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.0","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"611c611644b664e68d80ca47f40122b260868e44","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.0.tgz","fileCount":40,"integrity":"sha512-mOh2mCsL1JR695MT8EktRuWQ7xp/Jn2fs6AcK2O6ilbLR1dEj26xrppoxbkvw64Cz35UyHsvqVsmGKeyICCuIA==","signatures":[{"sig":"MEQCIArV4DxZKNb1pLpANtGwJCGeURUM/vRM0A+h5iRzovG7AiAVNVgrYwisFIQ93qXOta2ShnB2pht2h4X8b2CzB7DQ3w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdYQ5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrvIw/9FIhqGFj7BDfiUSJCUG2r3wH2jl2CKWmz+0QoEBluDGz/ocEi\r\niFpvrNHQJlyYjPFf91hRUKDhk0D6McnP6h2EYpNXbRgqLALtXcU6xFxTCoOq\r\ns7JhqVLkPvCEgO2ZH5WgC4JnbWmvJoOVquFcI0k/Oyg33NBzZzgIW1sU/rWD\r\n3jtdbp9zwQG+Vg7zbxYgPZnNq7VUR/X9Hyg/ZM7Hr2IPEuW1nHhcNga6Xdzw\r\n5QZYbeNkdP8s+ybwmo/BjB1jRORUU+DTfprXwERPdyczTd3Fm/gsgzEj0kBC\r\nvPU21qVO2ut6AjQqL3pKgTwbh86sJkGKFaCWEzGCLiKdEB6PdV/4/zLQtLj7\r\nm2gtv224IYdygc99DmgqU/+8kXHCgNFNsNIrPc2nHB+kyaoZq4jjJ+ZxLSoj\r\nypGNVEIGa/cp10waCU2FbeSq/9eglI2NhKbb+ve+DMdr/sQHqDiCH6VuYEKJ\r\n6ellE1TsmTul72VWgVR8hxBIuWWCRhl0Zlwb+m904lpU2Oy49v8iwpmlh5GH\r\n1WUSGNKkkWMzm33X7Y8w6eaHRt9mSegm5hyax84sIC/wrixsUzuUATFnkvtf\r\nQim+kULkSPELA5TORoRuYgiTWE8JF6brRy7spqrSzpA7/ERwhPkn/XqlZgSU\r\nAPcAy6SBSaj2ULR8EY8otTfNeqsZ8AO8CJA=\r\n=aRdC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"0a8a48f663dc0e1b6f09eff75af45a5377a05347","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.0"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.0_1668645945664_0.3547074746076604","host":"s3://npm-registry-packages"}},"0.15.1-beta.4903":{"name":"piral-pwa","version":"0.15.1-beta.4903","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.1-beta.4903","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5c13400c876a23526aed8d9ab4027332f2489f58","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.1-beta.4903.tgz","fileCount":40,"integrity":"sha512-LszQl32TjFpmCTbB0mgG+MvGJKnTvJyyMR0W8FbNhU3+B4mRgk/U/9IngA0NxmLxxAYmUCi3O0KMXlSYfmW/BA==","signatures":[{"sig":"MEUCIAvPRgd9INfnKpEwkUgr+jCMFr/t4AGmB28aRD9Vva57AiEAjLIdCKNuyMGodF/lXrivIrvhXDmyR+XGUqw9wStllio=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfq59ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRNw/+MHoEccJOcmG60bK+/UvLgUlWOoqfICaKtMb6Mm26vF7alulr\r\n+Jt3epQb1gx8yUt194/KU0lST/ieGbNKw5bly1cGClnrFaLSYZRW1QrcA5XM\r\nQiC8s1CEbllaSHUyFkmmwqKFoMl7EGDIhiXIalXFBTmfkw8/WUbO9EP7iOKb\r\neH8rprZAORVViKbyte6jJzzb5eOjMNXVNfjyyrwivFohAc0BwmeNL4Gt8Bn+\r\njssW8Fe5L5rfakL344GKcYpgFTDjbOFUg4Mrxs8kCoLu5lEJ21H8EVbsEo5E\r\nvhLucjGSB5A68STllWBq8mP4/o0Y7jy0OnPVbQoxmu5zEZwlZQiuc5Qg2Clt\r\nyU6cGBm96Ar4QZ3DGc5rXlDZeBGtsgLoJCMHg2zbRdUtdkgYdGJdLWM/z1ml\r\noAfReN6ia2qVmTuRjnLdxRI3BtevX3RT27802Gikq8FrfifU7BdVUrjoaIuB\r\nBV1CfOMlp/D2e7Ge5ppWZx8sChv5m4uzXRYklOA8KBQFtEm64d4oXmj42/ew\r\ntPP+6GXfadRUC4vY2anwDHvQc6+jiHYnt/eShXmLQGPZ7oP4IPafMJrg7nsK\r\nvUAvbZxOU3zaKYJYHjjUGWFoSXmmBXvPeHohsPZ6BcZnxDeR39S4zPNiBWDR\r\nYuqOyMf2Fd9M8PIX74bDbE24FuYq8Duc0/E=\r\n=RrOQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"352007618501b20c32b9d159744ea6ec0b3bfbb3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.1-beta.4903"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.1-beta.4903_1669246589374_0.760751810740284","host":"s3://npm-registry-packages"}},"0.15.1-beta.4906":{"name":"piral-pwa","version":"0.15.1-beta.4906","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.1-beta.4906","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e058171151173452c42a102fa3d77d05ebbc3d07","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.1-beta.4906.tgz","fileCount":40,"integrity":"sha512-r7SSZMcJLCzMiHvUpMVGmWIMwz4WXIO8TeqtFw7wrp9H3l8H3xAGG68vH8l/IOot+K6ekC7aIVG/ywhZfSJSAA==","signatures":[{"sig":"MEQCIAdg5I45UWTK6Odcep6rV1jdd4CYrR4zarZkEim5A/XaAiB4US4kj2V93GNyeuZxvhxV8lS4XbqalHqoSpK62eJ6GQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf39xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmosSw//fZcxkBzTfzEV+CX/fk2hZU5WuraAUu3xrnqFyBtmoxm5yp3d\r\nyjX9Z/f7mFBU1WuYIO8NLuFMO59Z6hQbiqjvpfRvJ8R8w89LHPLZSX1rWna2\r\n0NeZa0dEqfIkC5bBCKIY00uo4gLMH1eGqdFdfWNgHVHi6xTjNDjPQ2hYqSDm\r\nL7toTGhO+iRgge2FlXDm74ctIGb6RgAN8+5Aj/j1kTxFMU7H4HVZfQ1iqW/l\r\nrruQYhBgRyvAhCOxnoadkiyLsg55Hk8WKKSXyGKgjBN7lknCnXfwKPrtvJc3\r\nUCZcB7dARszFNpk7whCEfEuiDMlKSr/8nnKepfgZl3osqua9ydD6KdrtjZL/\r\nxMeR89Q1GIGkCSqobpGxuwGjJUQzsZYuA45HYDjiCeRUdhXbG1cPOxh2qdk3\r\nWzDZiGwzaPPLyM0U5hwuq/TVjjLQDkP+81nnbYxK9txUJmTTqZUdd3grFhVl\r\nrXgnfmQWc0o3r4um8yyLXBu4vi0Vn35Qdeivf8658lqZ541+JOwg3pnNWCc4\r\nkb7yk/vmA72gHHoEnLQoB1bNG00pafTqztmqH9EVFJM5dTPrt+C8vmb/gHZQ\r\nT3XBMuLc3d/7YXdUe33ZJs0RkcFGjzgr3ZwfWvjt0GSahxJjMGkUL46IId/T\r\nsDIcM/Yud0VWWdflnxWa74FwBLx5X/x9pl4=\r\n=tBsE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"478dd9009975d891b6734ea0a0ba499fc9212126","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.1-beta.4906"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.1-beta.4906_1669300081747_0.7038669720547475","host":"s3://npm-registry-packages"}},"0.15.1-beta.4908":{"name":"piral-pwa","version":"0.15.1-beta.4908","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.1-beta.4908","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0e6af07c3ec222fda6d2a4c20bd86f41bb1ba53b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.1-beta.4908.tgz","fileCount":40,"integrity":"sha512-AlVCjTrcOpBH19xtdV/Piis44Qv1TylW08nqzctW/aWRmyvt1uAP8BzFoJU1T/maI7+ETE5FiXVVjGxERLBG+A==","signatures":[{"sig":"MEQCIDABHdhM/e3fzrKYFkx/hne5w3Wf8ukGGcSkdfqKNFEAAiAYTXiAjyaH+wOmdARrDuihrf8YVolbNL2tvJe2SspIUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgAIxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorXg//TsvozouQMBNHBkgHatsi28TDFBgorofzSQ3lhApoHwS80IT5\r\ntNNAQpKz9h1F9cms0m61GgBSZR8vrT2S+Rpc54BU+QSmkPBllz+AE+fb7ctv\r\n3R3KW4Sn9RjDgBBoEz53tNlQ+gqmLenF+w0HXWah7bv3wKMWPBcgzRnn+mPh\r\nNrXxUGZJkrNGYD3Iqh+EAQw/g5alx5+xr8vmUySfgRWc0/8Sp0dVRlENF0ny\r\nHhSUfbxAZ0tM7LXzP2p+DD72obu4Tmb4KMz/mrElWUxklDx9ISfT/wF4nKnQ\r\nrUONW89+V6+Dn3g6BfUrC1MAcnIiGKhdNJSG+1pgwDXZZcFQgvj7b6fbYW4g\r\nEKtF68FU+zwzAIiaBHe0suOptUwJ4OoOq7B4XqlLar6jMSC3AJQb1nwPAYAi\r\nGKLssDjq34EbzW7t/hZmfkG8EMQzl83/+3dl2wevnDhr8viTj/cAXbvxV2Yj\r\nNDHOlMXR1As7OKL//HrpaFVcA1XTFZztdmNYwbvmGj780v5GlW2RKPvJTE2w\r\nZ0SSa4arid8Hmh49dfOpAjt3h2PZkjCPKUhB8cXAVsN8GGakstaSMRimlGZG\r\n1wiyWndDEy4ClK5BtIKadWMqk77CQ6qE47sfAMiZCSWfmr/sKu/CUz9hg6xI\r\nctScEpxL9I/P1o+dxWqr3EPlrOlIbDIA+q0=\r\n=am6t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"83a8aa5c0a1994ca184276864022e09da2e87195","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.1-beta.4908"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.1-beta.4908_1669333553502_0.4868070671552833","host":"s3://npm-registry-packages"}},"0.15.1-beta.4910":{"name":"piral-pwa","version":"0.15.1-beta.4910","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.1-beta.4910","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5cb5e2d3943774c9e06cc2f7ae8bf6065299432a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.1-beta.4910.tgz","fileCount":40,"integrity":"sha512-vCUOZQhdn71aTYnLTng9ZW/O6+f/qEwjnlPjHfSWPavA3UE+tZVSAVeRKY9GSOQqm+Sn5RSOQdU/hMMYV6KYrg==","signatures":[{"sig":"MEUCIA5F3voXhXfVhfIFbZCQ0JBtsv0SVww0WDmDmICnqOtuAiEA/aX0HrVVjwRYGYxlMA+HpruV34bhIKttGAtjevosyRo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgAUVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrH6xAAmHNpg+RubxB9OMNELScQKUN1GTeyGjZ7kZOu+X/tiY+2NAU6\r\nHI16HyKYvkxzGW0LIT8/C7dFFQdk+xvNTV1xcCgsq5n1hz6NzbgssYNc96dR\r\npgQ35ld3ZIc4vYJI5l0UM697wmOuOuHxoH5cULX9cyyg0x4CXXSOLheRWpic\r\nPOPaF1ma/IlRjWVChQE4YaqYSk+HOKHepKScSA1OZlKFyBeiU5GHfWxrJA9p\r\neXzmPqGFeTt2KpwnbyXMLNnhl/T0Dd/u+Kud6zKM+c5ermIwvFqBOR4B2as1\r\nYlJEeNNUHCtSDgim2cXl8FyQ62ZUXwGLvGuK8w0yBHdQvA7dcowj9g6V4kev\r\n6tlUZs6t6qSSgcALEn0LPXue4iN4lfc2DQ/SOgtYco5LrKhOq2wdP92ju0sh\r\nZ52GBptH5pSHN179JIO+jW0OhZUrxCh4R9hN2SwfOvyrldx1KFI7l2d6dbWM\r\nBbEN6+CrCdS2YLU9As28ZxeQ+f2gGJPI6iMyHWw9GjEn1c3c4omhxxZ5tZ4h\r\nk6l/K60Q11UKF5sxaLHyikVShLrL8n+h4iB877YtKqmZ/fM/7q7r7wrDQpee\r\nGL6g5Lntx5lBDFhwuWGftg05TcJ35ByVq6EZVIoukI02pFPfTEmkqyqXGsxW\r\nzKTHN3X+op8+dd1QIqdqF8hwgbtaEYCM3ao=\r\n=7kIa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"83a8aa5c0a1994ca184276864022e09da2e87195","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.1-beta.4910"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.1-beta.4910_1669334293377_0.004766947107822661","host":"s3://npm-registry-packages"}},"0.15.1":{"name":"piral-pwa","version":"0.15.1","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.1","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b67a18b838f9b35fec516354e6a02add8b764319","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.1.tgz","fileCount":40,"integrity":"sha512-8iedgjgBsGf4ApZHRBgAasTOvgS+E9lXe+TYpf418Px2iciXoJwEi7FZe8ZzdDFAEbB8KRSWGu7ESsSoV6q8hQ==","signatures":[{"sig":"MEUCIG6jZe05cZ6NY5NEgfEna2NjvRqbif6/sp8A6UH4Jyc3AiEAmXoswpD+lvXeg36DdHlrHuIq7cXOldJ1tDxCsgWv8OE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgKqYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqODA//aKPiwKvocsyowO+bqW9nwydhtHZYTkfmaCDKrLjbtrcCTgRj\r\njLb4e8IU8l5ufniU/Ua7A8/k/7107PIqE7FJq5eGyKAY8d/Ha5xIm/Hlb5hh\r\nniYbX+5xtS2sL5ZEP3Z3/GRUsXspmSxccP+j2uZNHN34CiQ//HZ2ixyXQC3S\r\n+RtZ6RCfU2JCiAhZtc+8v458kUQradT4b4x7rfQoY32ggAEs9mvc7fXyMylE\r\nIFyoYJXPXACBQZ3TI2WSvv1/IIAzyF0nMbeNB3Ii6F9oU77KJZ33JYHs4qQF\r\nB7KwPg9lXmMjLhDCsYPsoktpP1+4/i7EZpq5WMAD98Lf+spy8aSDFeGIjjdF\r\nCb2+sWDo81cUwdUIQ/JWubV4iHGTJcs86aAg2DNDM9iGS9FBuTz+xobYo5dq\r\nKxEkzWtJrqGOqwIUL1vU2c5GmuwGxhmX6qRmjVroE4poeIQ9lAIbuQlKqpwU\r\nUdK6cxWGNUT7dWl2Y5DvdUWpUD5Ppw7Bc1SgpPSXO7DLZ9ZLcObjP1puozad\r\nsxVUb040rLXSAyZIkRoQtJRK57Fcym9hSi2M/sHjNhQ/IXVnVfY1G0hNtYDF\r\n/b0nr8iqQ8aZTxYPIMjM8gx77pl6cELB1c23cXknR+XVUbZUBlaxuBZJqBdT\r\njnQJWetMg8Sd/hiZu36ztOVxwIPK4YG6xe8=\r\n=BCrn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"b1e17ccc03bd4a256ba20ff7e7bb2b899ef35102","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.1"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.1_1669376663827_0.5074259823199507","host":"s3://npm-registry-packages"}},"0.15.2-beta.4915":{"name":"piral-pwa","version":"0.15.2-beta.4915","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.2-beta.4915","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c4128bcb6cf2e7a6f2ee8112d6570d938b3c8787","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.2-beta.4915.tgz","fileCount":40,"integrity":"sha512-xyr2YJb9SLTbbPa+s4fMpQRvEU1eLxQUKfeLe7ZdN3rchfvSmjicU83yYAdHgKQdfzz1obnaG3LlquvsZllxNA==","signatures":[{"sig":"MEQCIEDYxXYr+kXx6JIqd2sMit5Y7DndYQ+73Z4DCwzUSmnAAiAVsYrFgeaxwTM2VI5ucm9+tpgPi9Zug7+o4q9MxEQjRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgxnFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrk2A//TJDGoFRNGJMfhIPdiNS2cnLVelCts5rhS9t34HNrd/Dqf24e\r\nwg4kTNiLgHKxaN3yycyw4PP28LAZSzesSX0GB3UkFH852q6WsoqiAPdvcBBz\r\nuK1hyzN+uG2ZVPb7OhfxZvQvG8ZupaTYe20pFBAVmCI2f9WFnO1A1VeTY4ti\r\nZX4l8j+nxI6GKK/2q8M469Wv6/iX+HovTOwTEp4qN+fdVkYdSQRqLENdwlBk\r\nQ/YnX62Aslz7Mj5bGHO44/PNUwEBHxHxNOA8nW7VWnk+KyON1y0Lm40dBLqe\r\n4tXB/uE+NQbKK5GkwWHSSpjdVsZNOzf9rfEW3Dz4dFTRw29Yedkr+tvqXJIY\r\noRuqC9VtXNTwi1To6ntrxgkCxowAzKnbFuNkc1eaAuP92Iy12GdQAOzzwAO/\r\nN097a4GALQSbZhQcH0WEbyEo+FixVymcK8cLQItXJkVEuS8oD5TVEgRikxiY\r\njsgIrkwP3R5whKnuLisg+J0VLE+SB44uytjuXJavBkC3N9fRsvtcoyR6X2e5\r\nccvCCehETq6uk7O0gc4COdFJX6dWLKpPaHgHor65xxzFYgsYKxtmG4ytkWvH\r\nL9BVaWkXwTEuAQvj/EBuanJKtlp0DDT87ve+Ci4c6wKCqXPhFp2f8D9nUD4y\r\nxH3Hf7KA27/TxqvEeXuU5BJfFmSIVdwBb/o=\r\n=+1iQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"5ab47435e95f3a568931505084459f6b59bf80c0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4915"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.2-beta.4915_1669536197308_0.8514500884035967","host":"s3://npm-registry-packages"}},"0.15.2-beta.4921":{"name":"piral-pwa","version":"0.15.2-beta.4921","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.2-beta.4921","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"05f3b276db993b649d0dac16c02cdbffb9af552c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.2-beta.4921.tgz","fileCount":40,"integrity":"sha512-RM9RsgC6q8oeu1TlN0qIkRwcsjSGVfQi3fkPMxqzwkc1c3Urz6/DCDGYeCjaNlg76Fsi1fdmG9a2BEqKd7EM9A==","signatures":[{"sig":"MEUCIQDdyvxhVyYljzvzGkkwNDL7OIerIynCXHmucvjPSprE4gIgWr+BdxLQg+nxHWw2AsX6DK5DMDZ77Q3IUa2VVGIbALU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhAQTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4WA/8C/Kt24PP9sLsxI7r5XfjlcqUOg1y6zPxw9LfihLOZ/ZwbtaH\r\nwjV2f9siJzwEWrfxSFDtoNcul/rtaZlmfr6HAlgEYy1/RUdw0/onIZc0O5Df\r\ngASG1HOEZ/ki8b8Q52qFbZPnqobFeAa17yXl5EYj3ruoZbJ3Ia/vcJvdp6Rh\r\nAsbu5/tPnA2Ppt15kMSuZyrcpKMCRa42pPaUX2AEjIaqJXqo1tYdiDZr3/rB\r\n288Oq1rSpyUDEs5YQ/og1JabWOIpYBdV0j0brIsw068S1M5llvH+Jooyk17e\r\ngoVHqpY6dbeObBI/wBMhKVevmC2EJ9DL4DQM3kdQyevMo8uXE8Q4tfMq8w4w\r\nYHtN9zTM9h1GQmnh7avcyd5ahbO0eRO61jtYvLaRRKa7oNScmIx/Zs+1Vmhs\r\nrOZ0mRwJu4jdHdEmp9KvZxXPSm6kCabuFVunRQvamLh+6/tU4ZXDwNtry5y1\r\nB9yYmpj4ByS6dmUOoVs3X6rui6yshQrVX35uoW6cQOp5P2ehjZJhshnmevPL\r\nZBHty54owXD16CsfKBf7FFScEVr98djBbHySQIwodeOUM7ZhNJpQBsglb+nV\r\nQK4BoNQvF8vGfRQ1IlJjath7GOZigzVyWRjnk+Wj+WljvzfumE7dZeg31XOd\r\nA6JsKTRTVwqNosabJorcNIwSaTZKPWepXI8=\r\n=QcBh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"e112a3859cfe8b9f7a4ee02be3cf5493f2482a94","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4921"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.2-beta.4921_1669596179246_0.5479209831718701","host":"s3://npm-registry-packages"}},"0.15.2-beta.4923":{"name":"piral-pwa","version":"0.15.2-beta.4923","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.2-beta.4923","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"051dbf81aeca5d89ca9eb9035d9a871f328faa07","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.2-beta.4923.tgz","fileCount":40,"integrity":"sha512-9AhEoFReostnXS3GVzLB8PVo/iw8n7PSseoPtS+xudAc6jYtQJvX3GxrVpPy6+/tDfOL8/fDFdO1+bTkXLK8Eg==","signatures":[{"sig":"MEUCIQDKGSh8bH4hcEZVOFBoF5w0Dr/OXhHujekRXJRQYlb8YwIgTLHUMk8rGXB9QBlTDMmaXS5G/7GvVSoehjfbs4ALhF0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhOE/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoqsw/+KfDADAsyXOdPHrHy8YxYXx1nS1oMGrKzyzn13l5jTVxoBhCY\r\nDhjN+kMTzF6whorrJy42WPZBy4phuy6cdBAzqR0gYHgdHMeLQZ/xosV4zbMo\r\nBAtuw7dqRb3M4D/06odLn0KCiIyTAQA5hLItR74+V6FISlHbzuOgd0qnON7N\r\nTg4tWHu3DJpWTB8x2iXh/HPKswbjYD8Mjnu5saWBG1eE21BjCUEOgefwQT4L\r\nXU6jGIHpJOwMxs9OGttELu2QxlpWXYOAbMgFQEvvS9FxkgaTva5g3IsU5r19\r\n/mhB7E+U1ujFC4zRh+Tp9vfOKxxvfPNlEOT42Vw7QFDC6fMmpU5DdxvPbyWK\r\np/HCf4ZBQgivsIgQ5d8UEI5E/qHxOr9LH9OzCwoLJ7R5rihOe6wrnyr5xXkO\r\nwM7wu7HS/FzfTor5qoH2nfZ9pg+27iA/d0FSK+AqiMbfCtKiawERzOJynDKh\r\nWv3qDUu8YVZsFDPBYIvOUW7L2j1cjWWHh9x9reawSW7WZJKZmgu/kYCC/x0l\r\nX7CiSoBuFm0/Zlsx4zH4p2j9eMhW2ryMzWRecZNHSKjdzthIiVpTW2hgBGZ7\r\nqrlsoftfJmBMm66tmvfQfVcld6gSW8KabgQ09WB87QpCTrYUvFM0/4r/4Qa9\r\njFqz+RPxSh+wnRQyIxwuRaj5gyeQg3ni9ZI=\r\n=6M91\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f4547fa8ee856430f74ae3c46f92df77c6700b8d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4923"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.2-beta.4923_1669652799150_0.8120244410581241","host":"s3://npm-registry-packages"}},"0.15.2-beta.4932":{"name":"piral-pwa","version":"0.15.2-beta.4932","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.2-beta.4932","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a28a031cc889db0edaefce49fe8a54710e7941de","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.2-beta.4932.tgz","fileCount":40,"integrity":"sha512-xGJG+Au7l+uELQNBE4w4kTc5lTs/66QcpjILdekHNTuZAun5pCPA7kN1UbyLsBAtOjleJJwxvkMoKDXsQTKmSA==","signatures":[{"sig":"MEYCIQCk3+dyP2L5dtw2vbPw9gSuE8ab2TWLy9uSEcaCP86o3QIhAOtHQfNX82jrBPR7lKYwtJN220FhEDsw1mlpB2eiVlPb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhrhlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmruXw//f962CGv8ocmgya1siKLYwPqmZ9GBjfz49ckXusgZd6t7wjBw\r\n7alFBowmv7sU01jf+U+cJBzDi49qRavGHiUzFuAUa02iLB7mQUNeg5XsLk7E\r\nwZTkFK+Azyot5Og+b/Z4do3X/v90ymNlYnEYil2vdSiKAXOT++p+p79SvUlJ\r\nuxMKd0M+S6xpG50MOea0E4uysQ9nbsjXOCwQWh3iWVNENYV/qdjL+h2PDYGD\r\nGijiXziztNfNeq9Bsle7wG7JVXv4JXVV4pP/HF/FAeeixOXt00Pg0O3fw3hN\r\nbfTSo629Ak2ceMZ0U7abU9vCpY0RZslx5kHt4xsAyKsJsDpDBHvDbXyDRXaA\r\np18wQJZ+twnqb/FFjZa2MTkK4a9Lbhvy/rrRSvNcfVOJ8nze6R4Ja+Wx0PC5\r\n2p+NurfrOSMA9ux8VL4ZiGWWdU/UVDdJldEJ16EaHMC/xHc5RZ3Y04jwZINp\r\n+ZnZPVJ0yJoKjA1TiZ82LoC5WGjM6JnLT7tzlbFq6MIP0ovkc6YzNdS5jbd9\r\nHVO+MbGBl+7d+K5PdajzbONqp9P/ueDMW2Oyti3hGVDQ/Y/wPvO/Lh1Ugxc1\r\n5IQYivxdDO0vP41v8KUiBrrsCGx1U+KT10XNNxvJqP9iW2so0aThdfJTur7U\r\ncFmf0SYEOMMCQMMznnCDK8jhutrcPztdULA=\r\n=giAP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"9c1242edc9f7bdd2255821500ca5503631cb7569","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4932"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.2-beta.4932_1669773413398_0.9314540317754574","host":"s3://npm-registry-packages"}},"0.15.2-beta.4938":{"name":"piral-pwa","version":"0.15.2-beta.4938","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.2-beta.4938","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"54b32587e912d00706de37f5845f2906d1f0f036","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.2-beta.4938.tgz","fileCount":40,"integrity":"sha512-FaS2N4DaEi4/oY4Qx50yDsYYSef9x0W/v6emGblB7VySniEhN/ujCvzS+5MQeJID45zXdGCmU9g71yX0JKatmg==","signatures":[{"sig":"MEUCIQCDOfBpvahCNHktZDLIbxsiEZ3y9zVNK3G8a/XaqdFE7AIgBGFx4swDvp/6eanMSA4tRHb1QtZzW6UWY/ew5n1ggxY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjifMaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobIg/+Ln6ZrCKsqoNWytGtS8yENBwW+FpZZSQKQYu108W0dWNh2pbP\r\nsd1jrboYjUlSO74ns15evRC/sxJTRJuaoUhUAjBxLlQRV9CuqQSegDx6MpuO\r\n8KIWfB3FqBUvRfitWAcnDMDayVeAzKr6Ek4Eu0nx6p3fVdkqJ5f6bdLn49j0\r\nSbJyxF3Odq6jwZB7HWqJl3/z0vsnzy0pRg3wGWUdEOchpPOYm4aHCreOOr3Z\r\nIcwjXGSmmVhUVzOX73g0RXYu2T70r30aeUlzTcM74Inkt5hlFwKKIcBJoK0J\r\nszRvxl6n4L6JFFBOpuCh9PA6AmhjXFIJVlCNw9XzMr9oys/YxTn1XKeCEfFZ\r\n1c6ApqcbPwdqGg+tEYq2V34eSzwVYkDeJmufzGhWjEThpWoL8LvGv9HYl0Sm\r\nV1rimOQaGkTYFRuKaGSWaYnV/H50LpVRxpEnO2Id8d0CbreMWASptO4rnFWs\r\neWoqeEQrazXJYtnDG3bopNICjbkVGLNXTLeOtdkNe5pVji5zqK+m54UD92Ta\r\nKIz3pTfUIIV0KB3xgveD0StqAvXaSDGqNS922IlyRPl8xMtMRSgnZQHstXkd\r\nbTe7cMOgQKpzzEZzZ1QIu7sD1h5/4tI/jl12Ph1Tfn/lST6tNVXGqowpKyB/\r\nxeA/JY3zy83ZgmqrsJyC59UZusZx6XddcTg=\r\n=xBqQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f0447352d4b8883b6476b5d1a260d4ec9cf2660d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4938"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.2-beta.4938_1669985050468_0.07200982990478488","host":"s3://npm-registry-packages"}},"0.15.2-beta.4941":{"name":"piral-pwa","version":"0.15.2-beta.4941","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.2-beta.4941","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"119421871f209cbe2186d14d1aa588aa55ccb262","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.2-beta.4941.tgz","fileCount":40,"integrity":"sha512-sp3OYBViCcJNGZneH653hI3w2j5TERBpZ8ZWVwC0GoNKaQXcDiSYKyyisTef1jB8g0yn6H3BdujNSc4C0ZknfA==","signatures":[{"sig":"MEYCIQD6ulhDdQey8nL0ALKLvdax1xR829JEdALdbh3oaTGIfQIhAKzr01NSjkJHhNOSYiH5xef+/N5WZmJerUjoWjKPW/JQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJji2FVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbaQ/+J91WX9Ser6Q4Do0B6F5/yuu9xUO0AJiYoeidUu0lQT290Zam\r\n0pO84r0+9jksBgrQdfQHSCZZacyRCL6EXSErQdZ47HSvFb5bj4+5fHS7wSjq\r\n9+yAg/GjmUaqKZdBMPBXRIzFc2OIa5v8Uhx8qJ3L4xu9Ig1yB4s4tAri7USs\r\nRc5QLu/crDTJ+sJ0Pe0bnnvS5IvpIVg7SZjXXor08tvH9O+H+42cOECZtLVO\r\neY/22Dx45kHWpjp0wY4BpG71FtI+3H9E/Dja4/K4Q+IrW2x6Cw8t1/af+9UO\r\nNFID4K+sNNXPNExvZd9NI+aBlng9Eez8ES6lDJshVSqlnow8fK1aLd3b7tuL\r\nszXFUeyjYDOipJDJH7Cl73y1QbONX/mhtHCxm7F/Nlk9LqP+HyhI419fQKLl\r\nnAJ8sii4vmLva0K1KP3o3z0ku0B71fWqtWhvvq0IoJ6QynbjaQzrVkgFi9z7\r\nqEz7C6+urqceyCoAKQK+H+7b7z7Nj1rsosRqs6mZG0UPAXKsdZxToYKlT/0/\r\nXRqBax9F7Z6hh4mp/SVNWmnCxfLvfTC5toS/sVSZbuCe0eHdYxBnZ256f0Mr\r\nmB15qfaVNaMeZZrVovyIQ2GUSMwMlGnYNqySuqY9PrD4QJ8HLNL1tkx+nkwQ\r\nBJWhKcsO2R0Z37g5PVxvpNT9GzHAGXMPlcs=\r\n=tOW6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"4e71a1d41d662d8eefc520b2d9718d5d49e3df20","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4941"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.2-beta.4941_1670078805052_0.7101180799582758","host":"s3://npm-registry-packages"}},"0.15.2-beta.4943":{"name":"piral-pwa","version":"0.15.2-beta.4943","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.2-beta.4943","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f7c876218cc710bc9f5259b057f999492ca57878","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.2-beta.4943.tgz","fileCount":40,"integrity":"sha512-OxWvmJfpW+8m7+usXeaWVA/Q0J/BxAS7gjhXW8f9vXA2gdjyskLxX05urhYYxw5PLnZGP/Qia5Q/xTR09jMEJg==","signatures":[{"sig":"MEUCID3xEsyf6vg8ay3PYCGip0b+g0JM3LFTi+69LiYh6PoXAiEAnUOoIgWwJshMdn+95i0ezgR51JCU7BKutxke8N/qOgU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjSxpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrF3g/+ImiqomZmx47HjW3zWBCyMLhF1ss7ggMHZzLYWklnWuYTMX59\r\nj2QN762V6ANnkeqpxB9XI+6mHDOPAxJ756YO7mxID2RGQgLKuq7lVxBiBPBc\r\n7XOcP8WflCE3p6BURzpblDHjj9T3637iwAVBSxnCJaLfw1gxrr6RtOVqTnHx\r\nHXU85ktUVf6Y2q8YKovV00jd0ZWv7pngI4Oy0RR+L3H9Q63fjraCNocxxJ1r\r\n2eF8xhJUtEpNZAy8Hx34medKnK2u3LX+xdDbBKYU8g4NuQVyEs32URbzIgQA\r\nYoP4pc9VbcWtImx6OSHlmOfv7s1HE+9NL+uo9tAIDZ5pqa1ooruCKsHDA/hw\r\n+GXz3TxTL1/rt1G963mNX6LmqFIUsbAA1g1hD1IyYCWinen2liaW5uUY+AOj\r\naThGiDWgh4kFAn0TFjWO6sIb5v/Dl1193pcdOCyMDSCcKeuvRBx2KxYE341b\r\n9twaqAD3vjRrw3Y50PpptmMpBcODWX3kfsyu/qU93kpQHhXhuMeloccU9MI/\r\ncdqyPyLyuLlUmVFHWqpn61r5McD9rGQgWhMbJBPjnKk2NVEl11jsUvSmBIIU\r\nxSj6m3zWoaMPm9E7fkqu56w0jU+U6pSIqQdGlX0upnF2A+NiCTSO+K3p10hB\r\nb10rsCA0yuYyOIPhjWD0R0Nw7z2hNjM+SIU=\r\n=Z5G6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"af611d19717d71e6fa2504d040d59cff858586e3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.2-beta.4943"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.2-beta.4943_1670196328975_0.0676691300188772","host":"s3://npm-registry-packages"}},"0.15.2":{"name":"piral-pwa","version":"0.15.2","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.2","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"848f7dbb198a71d77a63efae326ca5904dc75b59","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.2.tgz","fileCount":40,"integrity":"sha512-cCC4xfcE8MEA165L3oTO8AVm2FUmvJ74vmzwGcUTGochlWk4NxXaYKqo/TbiteWP+G5mIW3/vFRF3EIHdnrdoA==","signatures":[{"sig":"MEQCICLbyuh3vPVoXey6zEAZ+yrpq2CM9x3OYW0kEoJ+ZHpZAiBnqRfCsHoAhW/9mf1lodYBRR6Iw13iomEtL8tSW+PYbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjUV+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqztA//dyc80ExTJe9hR8Mtot8JZC0GZiKMQ0pYCo6yQuuqDzQASD4A\r\nk7CH03k3iGORAXS71MJRM3DIMsgmrLbpr/HQZp/pQ3KNrDx/g+VQ4zcLbaKf\r\ntW//ArpdvirO1YGGO1qNVTxY/UvvFv3PSyOENjWvoyWMHOWcpU4Hkln3UWVB\r\n7W2+enCuAiDMKpPE5IQGwE75tvHs5ZsOUdgXBeS968BTdlKL08tz2LwfBjid\r\nhSiZgq6XQgVJNjt8pYtq9/7FzXwq+MvwuRtwnNwNMyKaAUGayocK4t5vL3wY\r\njTmUENbl04JDFGkg2Pbbh4gAE1b7DUl4Pv+hyTkoWzC9IdX7RMrmE8iT/1u6\r\nAYmRW3NwS80VwXzS29gJUgOMS8VFlplR0W1aS/LP4jiWl4YinXtUcggIJHtD\r\nfQQtrFb7tIhGAnq+tXfq8AbqFx5+bsGa95B+CJVDFCGWYugVP7Yz6wCgF2gH\r\nR5dD2EWRWDLg9PkeLxvMtl0m05FTmMOTdpuxy1SLjL0qt//WyOseb0zKkihZ\r\nrSUBq8a+NPO5xM1vtyw802fZHV/shbZ4IfFt+RTnQpuwrlDXb2s/C6P6nDgR\r\nAX4sDbQ4UxSnw1EHSX7osp6RYCG2voWe6EyC+35wnKa1yAxfuM3dx9mvA2iY\r\nNXQwJHzIMz1fnOS0MC9EIOMG0RePCSVGq+k=\r\n=mrAN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"bc75b95ab53edf3f6bda24bcc7682be0c578f68a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.2"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.2_1670202750616_0.5065450887271796","host":"s3://npm-registry-packages"}},"0.15.3-beta.4955":{"name":"piral-pwa","version":"0.15.3-beta.4955","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.3-beta.4955","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"2b8b7d1149a541f73c55f2d055cc6cd5a657d4e6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.3-beta.4955.tgz","fileCount":40,"integrity":"sha512-F4z6Z9M01+ZrNaBPZgJ4uyIiDqFYSvimZytYF9LTtWx3yAfAFU2al8RRskUAh8ARrH9K2F5lHCzb/m9J5756BQ==","signatures":[{"sig":"MEUCIQCXWJDt7bLEoiHUgjuU34VRL+BDclLbgzxyDP4iSMTMqwIgFozFQr6Uya/F9ircnV2aN7Ozy+UZ5mCtju0BFXJ6p+I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjk27lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqznw//ZxnPa57FRQth4F1xLBmBAmMoNO9Ie81zGfGzMXosR+jqxOjO\r\naEvcltsocDJOlm390s4Jp0V1z0DsgWi/TVflpxZummnULdfAIg1hI3waQIRa\r\n7bsB/RUxwtLnkMuiu6VSs8qV3EUtbTP5koWToBCRZYOQF7pedrkQxT1I5lfo\r\nCcHI9VNdBPHwlrDXq1bP/CDQJm6KIsXNT3vGjoARmeYC7c45pWeS+nUtF2Wy\r\nfM1yBCQzqs/tpC6Wq/K/xSnsgwgsneHh4Y6KJu+mg8bp5s4UJbfcoWcGFXCq\r\nKfl9TMAjAXhZvT1c/rTxIInX/sNXMHZF6RInb4cp3SxVNV7z2ZJRM/NqzfpA\r\nW+CokXnXulsTsg9gj2c6df+8H8lcGCo62MHBbQ0lFXXl7K5IoiTKnd2h8Ioa\r\nw7PRvBdC+IJOdS9blKnJp2uJzokt5M9CnWyaqHBxPliXz6Ec+SJPERfeQiZ+\r\n3ATHgaL3W7gGTalj8Obss/JeDzVlJjuZ3avQIsNZoB61rpmua3FKp0hqiyxK\r\n0NUmKgizE7zCwGx1XTXN1ekSQZ30iEgnEegO8AfoXFDd7USkSbhPLs0UI66r\r\n/TWIuk7RRlQcHDFsIu4qxN9+yohujtg/gFhbiMsMTkhpUhiho+Ya0pFJTg2F\r\nBdTwnu6fo+DMaoLRlFaoGX2tDxK29tZTaU4=\r\n=uVZb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"598563720dff2995e2ccc4acb07167554ce788d9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.3-beta.4955"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.3-beta.4955_1670606565464_0.2718994774048453","host":"s3://npm-registry-packages"}},"0.15.3-beta.4970":{"name":"piral-pwa","version":"0.15.3-beta.4970","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.3-beta.4970","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a5404cb14fc36531b09debc694b70f7554e71a41","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.3-beta.4970.tgz","fileCount":40,"integrity":"sha512-HadJVEkXU5ww1gHdW/BK6NNFzK3i4DfooYryP6PtBpMJDEGbiBymKMw1QFgmrIYTykGIMXGnmC4hTGzZbz4GiA==","signatures":[{"sig":"MEYCIQCzRSKxv+gePc0m9zB5uOOByvVuPviUV6sK4TgaWRvSDwIhANaMm+DCZlFhaUAqjnGyZ76KQtYxk11xZJfC5t3NfmPc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmF+QACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpkeg//a3R+fplpr9XR23BtxU7Q2Afu+LUwoUTsRZoOAzEf+QuP9Mk8\r\nY/XZmqeX2UvWcIWEb/rxUWO72ILfzdBWUSGbjlBZPY4XXB074lMVvLCumb7Z\r\nX2VXpSlXP5ia5IUG2we7F9P9+CD8/C7xEvn66gEnXtSygmWcigDtayW3gdhP\r\nmXZWDtOf98dOzAlO0ol4LcmY2Z196C+4BPsdAKivXBcaMyfx+7l2sWuykxUv\r\ng2z3Gp/yf2DibF3SaPbmTAJbsKetdO1YbsQwLrW2rytkQmpbhbBATqHxGB46\r\nZogwaBNZGU5kOyS/ssGXYYbI2xFPOSdk1QMi/fur5OYQmBpDJlu9IvrJX4os\r\nswGwW26L2HaewuNIBiIUi7patmemL7CJougB0tjO4+uzttopBvX20jy2HSCo\r\nQIs1W9gUTAz7kwDaWg4DK/uHg/y0dv7YjgElla8AV/OtcwUtudJpXCERB/Je\r\nVF0aJbtt/UUwa8nKKuMiQfOEyp960gKHFmBQLFSOJydLAfvshEAmPPn5/TQO\r\ni+vMiMvnfAImrOty+JVshWFUirzYQuyGEkBAHC2SalUE6F3UI6IHKQSyhpJy\r\n3wxBmeebfrJSvI5e6VFKzcM7sNTU/eL7r1Ul1/rYzS2V7i2eAoibFr22rGoq\r\nzaefV5dhedwmmq9D0COt8o+asfvMjHuAjS0=\r\n=O7+l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f82139bec739a47bf7e7194c5e075e14e6064a8d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.3-beta.4970"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.3-beta.4970_1670930320247_0.08771581666834538","host":"s3://npm-registry-packages"}},"0.15.3-beta.4975":{"name":"piral-pwa","version":"0.15.3-beta.4975","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.3-beta.4975","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"21f8597099a51fd5186672f55bfc0114189c3169","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.3-beta.4975.tgz","fileCount":40,"integrity":"sha512-614ito9fN4WyeaLlPJJucyK7b4Zcrt6h0vIY95IFhkfkxYzk72RsfM3xN8azDzNzzl8OKoYqTPlt2qE5bg1rKA==","signatures":[{"sig":"MEYCIQCA531NpwoHpI72O6pbijfs9DDWJ3c4JqrHn1lvP8UuuQIhALwuNAj6ui1Z4ZjYgqb6Epc/cZ9s78WRA92vNe1IzQYC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmLK1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrC4Q/9EqgyvpcNm7aVp6LgSW8xxukmOvvqOm2sVYKPMiG6qE1mr8i9\r\nLdpWESNTDBiuT+mcQm9b5LLVwZauuktGQsNc6ztM8jQVy4LoAmX6xn0K3bYt\r\nmQWultY0vxGuUU2ADxgo14aGZlsSuB/xusjdQRkGZNKfGm7leInkUiHLMiyt\r\np7S0M5g8Ad/E2y8HQD/MPwCpgexS783l/zzfiIcknMpFdspAz1Ajc9qHkUQ0\r\nFzdlwXT2SlO8BtO0f2VeFxMgPdrVBDeJVM2GkKN0ZZm7MjkQugjV6Bgi7rJ+\r\nll5yOyTqfjVXlfm+FLDWA4sw+3dlkWd3nubGd1COpWQYlKx09ySCXEQIv48O\r\nO0HAvKCaYX2ryNIDab4jqiJeQ+Ery7iCBzRsVdgJi+nI8kz4FHYAi19uItpa\r\nR5WtKwsqaz0J8N4cp0mAaIOD8Evijik5nRjeBiXWfl58SEYaQbliiXBm6TwY\r\nUmPIWO7rExMoXEd1txExNZc147vZUpAB5Rb5cdqVXn4aCWctszhtCX1gHHG0\r\nkIbQIEK8EvJbCzN+levl0/P/AjjVjSiwm3D4VtRJeRmJIKZKhSs4Us9cGxvu\r\nXaP/mjKHG2GvegSJDzW6MOMxTSKHF89B0ExR3VHagG0o4AuIARthWqYX/bV2\r\nebyWAfkNjdbcIn/6DdaM0yTtw2xJb1f9k1w=\r\n=5STY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"5cf09cee48aa723ebe3fa9e48a98ff118f3cb6dc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.3-beta.4975"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.3-beta.4975_1670951605787_0.24907217825033046","host":"s3://npm-registry-packages"}},"0.15.3-beta.4989":{"name":"piral-pwa","version":"0.15.3-beta.4989","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.3-beta.4989","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5a4baa1faec079f9ea797dc4e49e48bc23c22327","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.3-beta.4989.tgz","fileCount":40,"integrity":"sha512-d4TRoztVLycpSRkA9aDdVXZel5pRvmu0HaGIgs3x5iHTuWiTbu9zX+2JMdJLG1jHlrbl+XA83/lBmZba3BAgNQ==","signatures":[{"sig":"MEQCIBxhVMXcQhYxElZiJ6OPHz/CNh/APVMM4X1H24vT6YCgAiBSCNsB4Vwjj6eGEH1mo2V3i03x/fssUPli4IKndkXk9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjm74pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpoXg//VV19yj9JFPHCKbaNlsRt2zn9Zhr+xfhBYlGxYyuUID4tf0JB\r\nT5brKoECj+M8ef49Zo+Az8pVBmWo0uqr0cDW2gDmKTg50UjV7TiyE9/4b7b7\r\nV2QKDeOpO/lzJFR0jFgw2QdOgsCm0MmXx4s9cjVuEx0xrr4Nx5vVAZ8rVBlu\r\npO8IuBDxsC3eKWM4AN2Rj6BFA+Iu1ADE3SKSesIQ+A0DLewgwAYolofyQ4qI\r\nBBrD492dmHrbRUx3z0iKQEq769B75fBuNtU8Hu/f1Lb94RB9HvoGr/Ph8Lo2\r\nhC6ciNmMPmhp6vl6c/GAQEQFI5sGrnjRrSdxQ8m0bRbsMkm8t4I8nlmeNHG0\r\nUPzdzGK/FLa2l7IyBWFqjBHy6CdXeSO0OvNFZ2OOC9MNjsD8bRG5vktcMOCq\r\nseC3HZ8n9dhAcGEnvF3SzToJggBGYMpdgmXAlGlzfHbL2Fmv06kdh78sbxlj\r\nXKnuqv+a0KZt9cga5vCLx/Vkk+Hw7pJynieqMSK4TrBbOH3ltI/9CLmtI9gu\r\na0SKZaDhv0ly+mZcbrka9wD/MJIUn5w52eNW0CasPUCAFYIrUut9hi97g16v\r\nYrV7czqKttZe/kLtR4hPT+lncyinciQYrVGeAanSMN2vFK/7nlxmIP8YEDe+\r\nN6z7zUw3MpX2htLuPoYBBWGwKjibG0LzkfM=\r\n=qLzU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"57af209be93d79b5bbf2996f2c3b55fdd8e1e2d1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.3-beta.4989"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.3-beta.4989_1671151144868_0.6045501464977119","host":"s3://npm-registry-packages"}},"0.15.3":{"name":"piral-pwa","version":"0.15.3","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.3","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8c23d35c9227f92d31dd97f976c0d251b76d24a7","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.3.tgz","fileCount":40,"integrity":"sha512-n7WEAnvrFs57yzDZsE6wLBSWasngbDxwJyP44JhP0hyq0+FCA/ytemmXyEB21nc5ghA1iYDjNtYGbBJsQ1X4eQ==","signatures":[{"sig":"MEQCICL4oCT4u4T8/BAvFLdFoqfR3rJAgVmSghXcwtsPqQTpAiB5F4Fq+6yWNKp2KuZo0CGBpKZ+kZGhJr/g3oEWXPZDww==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjnJwgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7Ug//QLpz2Ma0UGi1c7h1uLkIp698UQ81yGkzXb2gdHZ3TJA94cjn\r\nVql+ocAAFXtWpsM5wWaLucHJOBfgjqjsqKKuvD73379nAGL0m+WU3VnaKXTT\r\nQ2qnive4IPwx2576I6eXh+wF+6s8znsocYzW0UGI2xiWYyuzJjviLEzXCAtp\r\nRIrVEKvcgBFZvkxXvQgTh7asLv7ozdaztJKdtgTgPBiUHUmZ8iEH8ggqPheN\r\nJKaM6DXfsY/nmbOrrSIG4SZ3BQSOELJNOf1+W59Zhw/jRRd/n9L6p4zZAB00\r\nyUoZShX8ep6e2rc/LpTV3gCVUklnV+cFDixAZcZ6gLesj5BGtMMfKiKdMtgA\r\ncl3hYRR9Dw6VIcVrTdqoAe7vzn578H44Dki2I+E1d+brheOkPNz2SGBUMYtj\r\nXx8bf/ZHyVoPH+bPDtz5uV/R2jcWpy+1caOTfsgAxlJSmCTIKDzqMLPANb81\r\n2Rx4uyKoxAD7JeF0IxKXuQAjDJS6BOGMmaOkVeG6lZaqC8wX7E9hARf/03W0\r\noZsygIJI1oNAPWmtY6dhHbzOAOC6T4iP8FY1urPm07gS+A/UJ6hHLwUOR6AQ\r\nR81lOYiPX9cOeJTzJIH62ia5sXJdapDm48VWKg0FKpfTXlqSoj5GUa2tjaZr\r\nvbsVNwrG3FovfFKkWvj1EsR3JsQjOicCtKM=\r\n=NArp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"14b0f1a34c86dd85bd66b66ebbca9c1dc5eb7f59","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.3"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.3_1671207967919_0.013370263419015593","host":"s3://npm-registry-packages"}},"0.15.4-beta.5008":{"name":"piral-pwa","version":"0.15.4-beta.5008","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.4-beta.5008","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"886cb34c593989ca1b71b0628dab04f30b1c8c2f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.4-beta.5008.tgz","fileCount":40,"integrity":"sha512-4yS8OdGWS2moJqKQWYkPSTHcSqqw02CLJXGXgU4QfeZzQo79zv+C0Je4bwrAkhGFr6pMlJO+oWC4Y3DLpCH8GQ==","signatures":[{"sig":"MEQCIG24qJVJfknfFTGrfNX2+0wycF5KOby4fbbHkZJPDEE0AiAQZ4dMcmMXuD5DO9V10b0nqhruPn+acgxd+FV4K0mxJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoIysACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5EhAAigoLZtIIZdt0gJhR3X4CZzV0r1J0k3GyxwHvnHHFieDU8i4o\r\npG4e377HVNHLRNkfHEgD5yNtKM3S3xRD/0qeMNH/epWtE5gQNWL57ZHb9ml7\r\nvxnEFW3yIERoghZm/hKpDr4LUXo1zYBjUAbwpb0MKNtHJ/garJGPN+fNYrdm\r\nGzGTAJJVR8opIaQ60RA5KYasWoSbV+06izmljZ2sSZJ3PYpA8ONs9sn9mBao\r\nSSoDud0woihUS5yJdbeQo0B3AfHbovMyfX4kRt45oT+MyoYfNio23T814tBY\r\nse7zh5MJrb5sjZppOb3xHUf0VpuNER5pHoRAlcOS3KQt8r8ycRgtzsflDiKc\r\nT6XjSHwJxc3feXw7QSht5SCJC7ybrjZFC2fUd+D1in5Z7y9cXRooqTSRBiDo\r\ncSgdgOFw+Li/pOs529Mi5S4R0rQG8b1XbIIr6zSRlqzXTr1i9PZbkB9YS1rq\r\nKnG8RIGSj7CWMKQuJp+wylnyK6xd/JzpkcI+Cg49aVefFV+7+86TWXImohlj\r\nQpb+iHQw9x4YaeUmCAV7sTXpFa2rPBVNrcfB0JZ4y2I6jU3vh65E0NE8SvQ6\r\ni6RKRB6T3z34p8SkzNAO/64OMiEc6XuHsEjyvHXwEDb91w0H1fnvRPNbWz04\r\nRfjOmPo8a3QaMftkytk6LS/0uLnnk/fNaAo=\r\n=S7HJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"5f49f50dddc72a067e51f83c023aab066e5479fc","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.4-beta.5008"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.4-beta.5008_1671466155963_0.5864658133613592","host":"s3://npm-registry-packages"}},"0.15.4-beta.5013":{"name":"piral-pwa","version":"0.15.4-beta.5013","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.4-beta.5013","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"45964ac33769544e626f089e3927fa16f3deec13","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.4-beta.5013.tgz","fileCount":40,"integrity":"sha512-xZvf/Sf3LPDJ/RAPt5C/xy+ChjOxOHRmbtWUXTCf/RUlWF4w6SIbH6gHd29OB0VJUro4E5jb9OV/92eM+S8Y1Q==","signatures":[{"sig":"MEUCIQDP5KrTtvRR9IhNgpzINKkYHvVRxAuqwFlU3pyrykC5vwIgB3Wufz9VDr3hMIwdzjMDkBjd2chkOjvN1aC3sMr9aPQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjovdTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYJA//WCfSptLq9s0sMcHMW8ChBmpN3u1Q3Dk7J1vRyLteUd59w4Sl\r\npikmmjnR09nP/LPOIYWPB5eVjmYP9thHC3u5gTbDUbHgMgCuZvdvWy6M8TRZ\r\nYgUu1Lpdu7GK4IysyVezhuAShWSpmkRRUvgamx8CWaIy0ps1P+BcjvTqxNw/\r\n61DL/k2UC0uJ/t+WdJWlZgP8paK/A5eRXRvPRVBGDhl1J5g6gD6fqEsR4pwB\r\ncmIgg3jrsCs90137Vp3v17MmdJ3OWVM5+Ma2DkTqBP9UXwLTr0yXwUcwG21P\r\nYyl63h/BTrhkGU/iS7yeQ1UB4Nmnq68yQdGgTqNtp9Mz2krgnA6zYOXFS3xv\r\nuf+5FTHqyQvfw5G/h4IAOpHf0JZoQKoE5hoU8lyv6HJ03TLLXO257fJzOzMB\r\nGGMZi3aXVwgMI+FAzgo3O/NQ0xJgNThiBTiFFrsnzj7DcSCqvEQvHwuKL47Y\r\nhiFV+8T+TRSg+sOyt5VSu7CB06oCmkBYN4tp/BlnEkNrtiDHo0ytTKf3t4zG\r\nnahKTbpjCa+9jw73DaWQpKNvMiEOh0xOhllbdhfO+lOw2SVdrIEUZXbB4bao\r\ndjK9PKhIMEaugmZa+Dj/xnvWB08VdxELw43VmUNKFefHlRTI7/et1oGIcrNO\r\npLzmPZG5y1/Ozn7j3mpewJDirUttBpE+nGU=\r\n=fnFI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"58a5f43b7d8f4ed1bf34b8cf79ac6f38de998419","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.4-beta.5013"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.4-beta.5013_1671624531534_0.6589112639430041","host":"s3://npm-registry-packages"}},"0.15.4-beta.5015":{"name":"piral-pwa","version":"0.15.4-beta.5015","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.4-beta.5015","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"bb828799c91ea71ab6ef09ac4bed3da4ec5cf057","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.4-beta.5015.tgz","fileCount":40,"integrity":"sha512-vg1XX3I9Hgni65dU0qScX+BuPzTzSCAbhUAe7VZq9n3nTNvKb/YDuEWgPI1PxyUmH7++kZl1qGexHJ/a+oaXZA==","signatures":[{"sig":"MEQCICSVUxuUX0KnBoq3ziKfgIpFqkCoM3ceNQ7+TOJ0NfvmAiBPS2ceZHpYVZZtQ1GNPSvJGpkgcrSKiXEt0QUdlmRQ4g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoxnvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpcQ//TnsdHXC+9LnV+KMekdLtnZLCyNBUEkgVHihXm3fzTRLgthSp\r\ntVGJ35+YxIW2uA/uYaLGtYMDa1Nqh9zkdTONBk9EHTUUP1q+q0SJoCFVHKBp\r\nuBGo+hDrQPzfLVaAcqRz/MgcAt3ED/7ZFhVvXV3G1u10Dx0zzg6eV3nbo3V9\r\nUPHMXKlaA+KZ4GYhTECjkjdmWzAJbYjehZmUD01vuYnza6TM93U4XzqEC3ez\r\nG4wu3XyxasHieOxyy8c607OgpDg3+QLTL4jRY7W3XOb3+Ohx8dy5LHZs9Lt4\r\nfFfB3yk0UT5SsZDAVhXYcin6QClVocFYrl10xh1Ck5L6gauVMUwLlbD5JEY7\r\ncSsaDSXZJXyKXR1IBnuDjeJ9mydOXrYYNoK0Mz0jWo9EYzR82CKQeDOTksjm\r\nyZjym4rs/NJR2XW2sSjGpxaPRZnkcVr+ySzXcl6rGbV1dvGt7WzbEvIHL84C\r\nLc2kGWsVAQ31ag2VqrHEql8sAjBxLLmqShCz4zhHLCRwho5/L7POvSbfqfHh\r\naXosVKrBND3e9yO+3wtNcccjODi7rTUmdZkbp85Ae9ndc5GgpSqk4abImXj4\r\nOQycR2FiQdrpLjgIHPbil4jym3MbQ0JrjHZsG5PIlAvt41nzPY8OR/l9wh7O\r\n6Vmlpsj6g4f/7SvjQyCKn3D9HKCffd4gLlc=\r\n=P+Vf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"b82a02274c524dee34c75f51744de1e1a1e43b23","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.4-beta.5015"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.4-beta.5015_1671633391502_0.2903132559932029","host":"s3://npm-registry-packages"}},"0.15.4":{"name":"piral-pwa","version":"0.15.4","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.4","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"78ee5dfe80a74897de995569d9b50968cf7c6c8b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.4.tgz","fileCount":40,"integrity":"sha512-MAjIXYAamSdJtDFxzpdGHoqlsjfob+Mezt4ZoVXzJQvh55JrA7RLMbPoafZlW8KP2B6nomSaLjsGe8uMUYez8g==","signatures":[{"sig":"MEUCIQDlFN1inx0Kztf5DnHmov7dOTwgYegbTcG+7YgqboXgbAIgKMlR7bYrQSKA5pDrjvBeAENj6W3+98GNpE/28L6fQAU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoyyOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTGw/+NhxcoO7A1Ga7VSwgWBG26C9CqYPPoVJgwBdfSIz3ZzCooDdT\r\n6YnJua9FB0rDducuGGPDXAmiBIfMP8pOTlCZ/ajmQk3/XXPdfncwTFrazQfl\r\noWkeaQN604ypUxDCUE/3n7O6Vmr5lglcKWtg3ilnEo32usRKL0j4Zn6miG0p\r\nC0eRd64sT3QDNfbdh3mBT0hU3i/Hw4f+sY8dnTu2Ynn8qe7SyM2gCZeWp8rI\r\n9H26PvKGvvS4fQqYI7Y/zHxFDjCma3Zu7ZRaNO3fJANYIX/kS8lkOc95Fi1J\r\naofoOh0xnfAE0+Z+5i/4xqJ9dW8BZa3NMYnuLccKD/UkRjvuPgpzywsmtBJG\r\nWFll9xzfFtt7x/HRcqxhcnppR1FfhgwBYSlC6Phz05YsLeTID8PSzVgxyCGw\r\nY2Cg1oE4iBBSZEW7g4j+kSDI+Hu0ACM7TZ3jVyeCybqdgdk1SexEsX2XcPim\r\nWlsh1hplADt2x6gSRZHSbqs91stDmuG2GRMCclG05qSWNSHcRWCLBcCrweUE\r\nSQ39ZYN4Nqe7JaD7R0cTScv0FUkO97p/xRsjEGEjmNm1HFEgUW/gCtliwsvy\r\nqFpK/wVKQE4CJwUmFEeWs1XflKgnDtvps5IqrmXiFJHgtHvmNwlfbzwBJ7c8\r\nbjB5yumo7OOllM2xC4c1oeB46ojdObL4GCg=\r\n=3rXQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"dd411b8135d77df856bd8b5b1cd3b7aab7366ff3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.4"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.4_1671638157844_0.20545261618863742","host":"s3://npm-registry-packages"}},"0.15.5-beta.5022":{"name":"piral-pwa","version":"0.15.5-beta.5022","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.5-beta.5022","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"47538cd3cd78bbe05c80c99c09c8a3c833070514","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.5-beta.5022.tgz","fileCount":40,"integrity":"sha512-qrk3uFENb12pCeiaF85hE5qL+hqcsqTHwDpwUTOhJiQLYtMt+38lDUggvKGtw7z3ILAVj9FUe5jFMRXr2dXnsw==","signatures":[{"sig":"MEUCIQCyZuTyQSkMDE3HVMfzbUgo8qILWSrG5Ae360G9QbqvAQIgW2n2N3SNGAmCixt1pu8aRgYiZukl94zNRLwux0Jaxnk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpLucACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomPxAAmXZOkzWD4HnDuXuGH9k113xmHSNQqOpItfBPJm2s2JGvE9JH\r\nZBpsrXzBxEL4jUwRDt0/f2DRB0qcFLPQTo+GFNsGcUWtRkP0gAgpql9k9vsP\r\nFYKv2XgTPM/5cKzRR5IDVKb3AoF3dvlyz9VuEOwJWekVByVJgSHYLuCdhDlY\r\nN0wJhD7QZi3PrpTDNmiDAKgFLVe2RVOOugM/XS7bW0JfpIoqV/2kQASvuFtQ\r\nQ7spuF9tQO+/aivcykUe1YCyNe8CGyo1Vd7Xwp7qY4iqhg9MwjXO4lZSZAJM\r\nwFp2G8btC3nm7k3maVTzlNQ7tjF+NuTdFljWQ2dHVkptE7BYIOIQxh4emR1K\r\nIKn5OcCAL6AwVKHeWVZszaCx+plj4GddgjqzoRgbHbh4E8YNUYntCF/r7B9Q\r\nVjMXYiZbbZzvKk6BynXT8KwUFiKR+OP/B2kJfMXyTHpsvxF20EHnjqotMnzI\r\n3YbQ+LLQvPmsDv4ObAGhjaNZQoKR9aECmhiTOGg1zoG76050JLdZwQdFcIuf\r\nQvcmg71MMz6YFRjH8475sY7MYmFygP+aUyMRDCAEIS7hLf5Hkim6zMyaHXNH\r\nA8NQktZ48yCFXngs6KJ4l8A5RIoStCiDZ019YirqDTaf+uq85QLqPemw6P3x\r\ngvewWz6w2IvOaxJng5r3AIL0UwFl8fcCIyw=\r\n=RaM3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"6a7d7676f6ec04815529ba9a8e4ed012495a85c8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.5-beta.5022"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.5-beta.5022_1671740315922_0.7656084723420471","host":"s3://npm-registry-packages"}},"0.15.5-beta.5054":{"name":"piral-pwa","version":"0.15.5-beta.5054","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.5-beta.5054","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ec1da20295002b55800fa2083eb8e9ec0339d6dc","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.5-beta.5054.tgz","fileCount":40,"integrity":"sha512-hF+fHWqG7HaH/Xhh33hB+XyxsiTMhmEezM73ekG+AasczsIRuwWCcF9SGv39/Ocj7wPKh8bORVVIL5EfhMi4zg==","signatures":[{"sig":"MEQCIB6MXN/OiqYdqh5SaLvES4AI/VHxL8hl42KpbQcSnxL5AiB21M7evDZDMpUfM88Z6wZAj61uRCFo3x9b2X/xPNc/xg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxSIiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpaNA/9FQRR2Z6Ujw+cKGSnK7JoYalv0cmFRPoaUuSgcDjzB/YcXBAH\r\nkvXf3Y2A05Enbmusi26Nk9Th183EXjtUmBeJ/tuv6gRGI9UyV467Dj0zNkNR\r\nTaeTcLvvpNKRC1Ar5cL2ZumHfljLXEHUGycRGE7fGQUEzJY0aeNuiyXyL+yH\r\n4IKvPlcz/LxJaTXuexGQxfLkEngsG7Z72fDMIk6m1EtvQCJ0H768zli/48jL\r\nXe5UIhIpygc20RIilgGpXucUmqf2MPx7Wfc69T2MEnsvExElxXw/D20VKZ9z\r\nlf4Dv0YU4QJpIp7rQg7WJG5ChYgYXQ1ksc0tz0/ZOUkUjyW9KTZFr9txSz1M\r\nwvcpiKzmLlEutTc8aj+xMKS+UF7VPi2fAyLgxsUhC88w7KrQK3q2DeO+7c0g\r\nPQtz5vqnvXWJfMFY76lzhssa3eZnogZVrazwt7cBPq/KksuPydNqeixcgMkf\r\nyIHFlnoKiyO4KxkFzERjk4phZKKhagHxA6aTH9mB/lrvyk4gBRqptgHq4aKw\r\nHE4gMWssU1b3QGqvL+1i5ylYhYNbtUC9Df7NQ3j9IuXM8yTuSk0wrofF4dhh\r\nRTxtqO/iZ9dKuW4fw/AoU5MLXRQMChaHKA/TzLlDP/AwqZXD/3jWXy6JGiFf\r\n76mhkK2yUhsYj+l5+H6uftQOKARt2GYMoKQ=\r\n=7g4z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"88a63d822efb26c0716e9364b6028b806aef1776","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.5-beta.5054"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.5-beta.5054_1673863714663_0.9179212572994773","host":"s3://npm-registry-packages"}},"0.15.5-beta.5073":{"name":"piral-pwa","version":"0.15.5-beta.5073","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.5-beta.5073","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fe602563add6bd3654a52210df6980f9e6a37887","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.5-beta.5073.tgz","fileCount":40,"integrity":"sha512-AExIr5QwqFmb8SxiYqsDTbJhCe06mQ0WeCQgYzOxCi1xyEXUypvakUqGNL045mBOwsWDBPD+f7XS7BWuVXTV3Q==","signatures":[{"sig":"MEUCIGCJV3k1N+BzQsiqaQbqS8Ynm5TXMwQ7JnKLsLnE60R3AiEA66il9LdWqeu2HQOMYNSwF037LXsuuJHVILlwWfn+5wg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjydupACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrqnw/+JoOnaZ6sKi8acKROHls5GAcqg506jMqXqfyaQBB+RQwp2wWb\r\nd3X96q3jTfX4gREdoxlJDWkTednPleiFytN6cUjMd8XYSQ+AJRT/fd9+WeyE\r\nSR0yfpWASFLST70JngucPfvVyO344s4j0lRG+Vv4Wgqb8++/iuAXoGHBade5\r\nwqXfLEOdgQvNyBlauyqkppW3JaJmTEaFixSCOqbXmBpUIoytLwDQkG4/TOsy\r\nTsPWGWQmnqrPsN3NU5HIY5X/TYxul4CKn59EbKJTuqcWgLTPnZ2KryTyxTm6\r\njxQ8lji7cu0k0qecMvTtk06hX5Kr+XmCF2Eog68AGq41ckX9Mw/5dZAaqXQL\r\nhiFmEkzO4XakJnkqx8Iz1i8uXURRiMtecTv436Rb+yoBggetHw2+Ls9z+y4I\r\nfAUaoy98NvpacnB/emypPofo2a4gulKcgQVICWL9WYSK87CTqzhm75yAKmET\r\n008+UISH+JXAIZqyijkO+NxQMhGvp5XFyXnE8j7NguBCXZiHBtVPY4uOXPMl\r\nYf+roQ2APBr5LKv1hkfJG4UuFK4+tkp8vjFQxNi7XoZ7zBP/happH4eTudyW\r\nQTlq46zwanNeVE82P1fBw7koB8+qId4zK1tMby/DQALlOabv6HPDMwFY+to0\r\nNwu2Ujxi/Rix5AMmkvhPQKgJvXt2gFJp03A=\r\n=MK5U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"40f4b17bd2cef4cdd5f38d71bd25d0459f043da6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.5-beta.5073"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.5-beta.5073_1674173353090_0.4979461046542859","host":"s3://npm-registry-packages"}},"0.15.5-beta.5087":{"name":"piral-pwa","version":"0.15.5-beta.5087","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.5-beta.5087","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"84dab53ea866a89bf39a2521515930c36db3a26d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.5-beta.5087.tgz","fileCount":40,"integrity":"sha512-p/GsTbL+jzcuPB1Dg3g35PpAUgCfBqR3igBmzUoOp+0uIz2jvL7P589iRbarxmKGiMpuarLEEVY/bGaPGzHAgQ==","signatures":[{"sig":"MEYCIQD1hEa4ZxZTJG8diw1BnDmMI2zgl/ubtMiGLG+SW8DogwIhANkUWiH17RhJ6dpKHcDRl53IZjhPHo+WAdvqDso+zUL7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjzkGrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLpA/+IRFgviuZSP11LQX/KKXdeNLsk8WhgMBNgc4ElhcbFIsi/7bN\r\n1ofjL0NMj0Q+32csbSXmnykvGWriMnZ2l2nxgOipN2mWZ8wOh58wjF/F9dHN\r\nywq/mOwcl73Z1zNa0Wbvpq9UBQjp19L6YZ5I/05Nv2289CqBxtkO6yYCXvKC\r\nKKKMWazVTVO3xYrGeHuxhQ61T8Yxb3aUUd3ApU1e1Qtlx+xPp/MddvInG1Wh\r\nPajDyAuVPP1uTa0tjP64xXIlk6X4JkM1CJJzbm1Q//MrvpvnLznKLK1xSfx+\r\n52X2seOR/iRL8f25OugacFwbbHU3W68ZMIex09kKq2UPtD47YsDUo/6zSEf3\r\nBr1CzEJ6+/45GncJyvVj4fhCiYvqAIW3/jYkBIoyqvICs5efC//7pg6axYuR\r\n/VB+hohoYQqcuTSmLJ+eu/FHlHFJcd+DsjcE6Xpt0+WLWbFRcuXmxzdyWtuf\r\nflwlr3JrmHoLyB5VRhXGDjzqS9uxAbhqolARQK48CLsV6ory0SVCEXvFoIET\r\nFoIXR395hnljMnkT7wFQUThbvoHJWb5ZWTwdFLFINxK+CRZQrWLF9pySTsby\r\nZQasetdBl3DoYEg50vMd8a5EqcxhSgWdiJUDI6zRv5OZBnwi81IfmpwLoKnX\r\nweNPtizkAcit/l2fw+KhYsJZcKgjjlZmcP8=\r\n=0Oz4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"1400433d425739439cf54a288334766ba0e84498","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.5-beta.5087"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.5-beta.5087_1674461611067_0.8714317726062313","host":"s3://npm-registry-packages"}},"0.15.5":{"name":"piral-pwa","version":"0.15.5","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.5","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f06b3e199b2bcb7cbee4fa1c990b66c7781554d3","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.5.tgz","fileCount":40,"integrity":"sha512-Hkx44CiJqTz22TdCZCyBv2EDiySHtMtMRscAg+2SI+9xloqB4cWJzq7JdlroaoZIdKZIHj5TuHAnz5Dbk4z29w==","signatures":[{"sig":"MEYCIQC4MyWFRu3SvbfFJoqSDFqEbG7Pu8o2pkUAwRYS3HKYbAIhAPr4IYayOIb0ENIDc3884R5Tp4Zt9ukfcVG7+Dc1LE0S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjzk6iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmosOQ//RFC/HCnGM57ORmO6ycTqr9mDox0f0QLp/iUg1vnjdRQU44CN\r\nsONGaPI/jb/rJHjNKwrF2NS/mWeLTcKHxm8rFvIHpFHChGR50NHDxE+G9XUY\r\nXD4DJKjDRkboXBCBrZKykesJh3LA9iVMUQjWj0p6QLVANd7OAzPl68RMW1GF\r\n4uFqqvF0Vb91FoaPdGlhgDJxN+0jeU5GpJuXpY6hK+cpawRscwSwEq7/CmQo\r\nf0YkmbE9cvwD/JpH4kCIRLgzMtNzSahMbfPHbrxbND7oIc8cdpsvjhks401G\r\ngWyyIbJUH7TRFRQczqL12L0+BbI/9FD8gc/N7XGMsb7oHK2duNWkAPgs+/9b\r\neIsBcFDPQm0H31Hd14FWo/4/mbaab60kw2B9bLbzUf4HhWcT7SY316u3gucf\r\nVNJ0l8O7N17FwUfWvtXWlGoEzyB8wl6FWhJU4h5prfGI0TA1fAstp7bBvACm\r\nWEnPSY0hTtxLqM4jYJchaBhe+ex7dRV3cWn9dRrvTO8iTcQUw5glJqTlHEUi\r\ntshELIrFKNhXOB1XI66EIum/icKIaxwwaDFVnrUBuGj54aQuXNy+I/xPYzwu\r\nCRtMjIUO8fU7wHp04s2BRgHdeGpOMN685TYuxQIUwXNfGAD6941ZbH+1dc8u\r\n3jq/3KeFYJkLXm9ItSEJQyd5TaaCd5q4Ues=\r\n=E8Vp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"b11ff3cab9580040060120aa6f1b122b21668459","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.5"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.5_1674464930176_0.31470397529912053","host":"s3://npm-registry-packages"}},"0.15.6-beta.5100":{"name":"piral-pwa","version":"0.15.6-beta.5100","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.6-beta.5100","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f1b44ba3e0d9dfb4ba382fec2d0d2f9c729c4d38","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.6-beta.5100.tgz","fileCount":40,"integrity":"sha512-ESguLD4GwHhQ3/2sDBdYJ+O2iA4pE6xLQgQl8wO8o1R7PI7K4qKjoJ6Jn177NQMc4AYl3rdJ0wm4GsvsOM3gsA==","signatures":[{"sig":"MEQCIFLbnDUGoKzIiiHe7dTG9tNmJEsD/sg65epDNS4gy0g/AiB9b4k6HgMywOtD/StRiH8fnenF1LMLvqPvVb1t3uDtJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0yEGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHlQ/8DW8ZLDJI0+5vYbDzDQOVQaXu5NEenBugKj4ldXhKknFrwUS8\r\nx8s+QFbUvP9OUdVrh/sq2tcMwRRLClNup9jrEk33QqALE9asJgPcoE/la9hU\r\n96lBjTYF4KJVIdHP5u60xZzdDIwsOm32Lm3PuaetXIn9vLo3RNlLqn2PvcqK\r\nyWL3C0jE6/sOSFqHhZOAqXhVJQZ4R4/nkLkGKEdCVZC9+GKgWIWcyXI/JOTh\r\nb6hEQi9o4PlLw6G/GMArXKrErtvsVyZvFx1ftvo052tofQTAphCxJ9CeRcAe\r\nR7YZkhS8qMKcUW5cWVrJxd2voO+Wb+KsKG/3UfatZ3RdreV32ARONns83hEQ\r\ny/IS8303RHi6/vrqoxh8w0hVJuQKuzyznuCAf2q1NldcYNGPAexpETn89aMr\r\nFp2bkokznGbdT5rHuqeORLlewvARx7Y0pafjZe8iFMWg7AbW+EWDoHcAecLc\r\n6Nev/7+5D6UixkA3C4LhXff3YdZAj3kALs+9GPb+VjCwCWKc+JM4WnNS8CDI\r\nRh4KZfHm2Wjhoyz+NLRWaliYcosXIaLlt0S+/m64IlKUCGDvTanzT18ubwKh\r\nsaUrfboJXltbrl86qacfx3Jpy4y83vBcTna2xJ0F4I6x6/MFUbXgsh3HYl0+\r\nIK0AM2NUMCK826lDxamb1CUPZ9ssAMETdAk=\r\n=h1Uc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"e3037bccd6f8bf036f49a057a9b92ca79e4b5442","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5100"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.6-beta.5100_1674780934242_0.52335133936938","host":"s3://npm-registry-packages"}},"0.15.6-beta.5103":{"name":"piral-pwa","version":"0.15.6-beta.5103","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.6-beta.5103","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"6f43a4cd4f54328c24a0c10afe9714a4d4a42b6e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.6-beta.5103.tgz","fileCount":40,"integrity":"sha512-lAYi912M4A2N7ZNRNAuYK6AiGVBrH/CUO4GTG9rrQGK1dmDI81M5ofLGAynHIZUNM0NQp9l2B5HvAuq5JgalyA==","signatures":[{"sig":"MEYCIQCfSwd15lxUraC9kwpNXEEuN5OaadEXhdCFUGEIAcNyHAIhAL2PwLZl1EHxHrtzWZZ+C9h4Q2fQ/yJs253G4gXQeDcN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj05SZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeVxAAlBPddaufUy46x8j5k5UogSwAR8RWLMsJ7KrqOpdzVOjojIY9\r\ns4w+I3MTzJwxudp2liZtXs9tt0d/3oA1kpVb03SmpLhpXZDX576EnS+eqqQD\r\nxVLUs+SIL2nHz+riDnQqDOU4qFWxlE66EhCvwUUYtH9MSzcAmm5X6hxa70Mu\r\ndQUQVYIDDg7yWlegy+QU2bEkrYUp/6i7Yqo35SKaxvr9VjsG7p62a5zyPQhr\r\n+4tO4bNxUYpo3/WV/JyNYzs1lINqZwqrWb9KIUu1TEMQsLllxc2NxNnyH1R1\r\nf92OTRrSrh6w79nOPsUOKVg1qhYHW59w26OWGeXeMa4K+jczCIxasVaFDtHa\r\n4vXkW/69+uwEXKocJWeUUEZbLp0L6RZ3Af5l34lSptZwm3Bi2PhkCdPVyHvx\r\nncSk3OAuRDGJ5hyZhsusEbRBFpheV5sIKlNN8xrQvnrxAQrK8WTZGpNfWe34\r\n7l8KRfoCAgeFxPtjbL98WD4TweDuxQiIYz5keKlHFKlceVI/cTee4Rk74X77\r\nzB0+eyZRafr/aIedsOlWfQIqtFj1HNS2lPpUL1DTcmLssJgWij2dzG34d93T\r\n+BVH183X59ppf9VZOI21vcvkr6GmQjC4W+ReBp+Xwhjiz3mHE+OsnO5oRMTD\r\n9pCvaS4YkpFoUo21wCa8lN68v9tT4JPC3I4=\r\n=3wNv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"82e92cfa7ed1bf3ee711a1c22c5a15ed10ac902f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5103"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.6-beta.5103_1674810521783_0.38346802989657847","host":"s3://npm-registry-packages"}},"0.15.6-beta.5105":{"name":"piral-pwa","version":"0.15.6-beta.5105","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.6-beta.5105","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"4a3f0fff1c4d18757a64138c8ece256ddd55d9e0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.6-beta.5105.tgz","fileCount":40,"integrity":"sha512-dKsOn0aYoaeIBSbWgvyYh1NHXIM2rFR7RpYNt3LTIzingwl81ol27xJd2V+SLVsYsCEygpVHKRtX37lOzwB2Lw==","signatures":[{"sig":"MEYCIQDjJvZ7MYqvpBlOWMEDUN9rKEHsTStfJfIxfj676hz4FAIhAMPGeKoDMX/Zek1MiTHIAIJKygE9qMu87S9kyRmTIWPu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj08z1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpl5A/+PlEFDoS5NBjzwe3atUGDK8og2Vd1dMSSwW2Z4QGGMZrKPRbb\r\n9/oqkNHpNBHm1iqI6pkRmV4JosDmisSKbp9fl/JiHuHk8dB2trRmInkEcx4B\r\nra7uvqmXvWfemVnQlX2nmnbFxDuU9OeoUgKa9KqwdkzUrBXXk1s/kk6vFQgd\r\nAE/qROd6vosU/aRRkMVEIGdQiapjSY1rKhozkA+UFdqT+DI7AlmwtXXop7d4\r\naooqwk2YFneW5H3dMzQSvWrWLMKgK/LNAH5KXb8LdK5Fdgw00pyL3Qy8M7Hb\r\nlj/npUpJBIzjfov2wBXBB35EmxkthQXxUpM1pTbSW+UzkC72DzWayZ/IQqRo\r\nUB3yp86iWFvsD3CqK5JsZ8pfvre7j0vjgHgBkCejvEKf29ha32VI0uPjpfii\r\n7vZ92VFDqRHmYUEfrIxEYQkBxJ4KSFM342p8C3v+g489X2dqcMTvE4/AuIIJ\r\nboW9StNoV0JNs8rYGSJTXJHEjvE3n9rdglZNCAtAjS/aXgh6MFwtx6IlvYaD\r\nG3TefbCrTX/AYi+Jh13Xrowt9YC85X/WQu7BefwnWXhuoK/Ws0XXM/ESyOeU\r\njJzaJGB5MMphp1mMRH3KWqUprn6DATNfnG7ygBtQdokgoC5xZucKA5EhlEMe\r\n63mxOCtD/QSXZO1Ls/vd0zY/jYKKOTeIRMg=\r\n=tC5+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"fe9f4af00df8a9281ba22e253e4ace0171160768","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5105"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.6-beta.5105_1674824949493_0.7609263268646651","host":"s3://npm-registry-packages"}},"0.15.6-beta.5106":{"name":"piral-pwa","version":"0.15.6-beta.5106","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.6-beta.5106","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"b6845f556dd9b0fbddd26e8dba9ff495ffb153ca","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.6-beta.5106.tgz","fileCount":40,"integrity":"sha512-FHXRJg8z6rsVC8R+jU2rZhL7vFCBt9iakUD+SWSX6yWjJJMsYKhfz+WJHMqf3dyWSfjXy8VgLMaFUPtpnyxryg==","signatures":[{"sig":"MEUCIQCfBsKYgTVMRnmnFzt4tARvJhZryM6Wx+ICuTAICrAbkwIgO0vxd0/ks178HP45DPOznp5PepirCENOkXUF21KJRv0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1C4FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp30A//Y+2l7bMubYeeYuyPmXCfuwvqvcQxjOM+p7VpB4WRTakTqCVR\r\nLPXToDdD5OAi6j98SGZmbe2RjvWqueYkBafUCehzadPUIm8qUGORUq3KfIss\r\nrh14Xd1lmEWdXMH5A/02QylPNx/dDsJ3W91I0Lnndz/T8M5RtXXTi0GpzcIM\r\ndeJbIWqOuIbTGexovbbLZ9gMsoY2SI2XXKfSlotL58IgKcWwXNepbHvfMPIK\r\naYbX029skaGTv4rFO180OGNRbGyDVm52r0VB5Qanu4POAU5ZNQCvypIIEV+u\r\nwUEnd6mk2v1OaaNkkF8XsQtB9B+bC9kVt6+yblOkn1vfH6+qCdHXXxOSFlCk\r\nMgCIisjMH8k+DKJiKb+fVuKxHGG/niFPAD8kBY5anuw2GHeDVogR/fP1vY2a\r\nu/97PqnUs7qPEOvxjgI6JTSZDzdUvvGCAUSCDbWgwfYnLdMqrEFau80Y/KM9\r\nASkG+QstYSQua5Q54CT+kA7ITowFOhm/mt6GE0ExfL99HuVWpAsvQCIY7dlw\r\nIeSHt0BgkZosE8c5t8xRcM6neqTbtxilBD642/dK+DHpO0QhntOy8pld4w8G\r\nsKe7h+JgClTxT6FbFKOmX/AUh3J9N1MUAfEwUN1m4oSMaWrYITZh+cDiSlfB\r\nYmcxsk/+ChPhZ6wMLm6sUhfSGKL8PjDUcQc=\r\n=58bU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"98a0225f584d2da787255341b7e44df7e1137b94","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5106"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.6-beta.5106_1674849796825_0.3225297117837289","host":"s3://npm-registry-packages"}},"0.15.6-beta.5109":{"name":"piral-pwa","version":"0.15.6-beta.5109","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.6-beta.5109","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9f2608ba12fb3432b645c27a534a465a5b983c67","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.6-beta.5109.tgz","fileCount":40,"integrity":"sha512-6yFIoHYKUwvGYcsuTIVRWkeOxklnOaZc66g+dPMS1ZuSTb89WQLYhO2tkb91W9+4Hpp474J5/LOiOUWcgMhFVg==","signatures":[{"sig":"MEYCIQC+nKUIC2FDXApwq16tvdNaeSoQxDVwUiQ+nXk4nOqh3QIhALkSyeZZS/a5kFQ6LCkfY7/FZb6Avz2LrFsRTq3yDv1m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1Yn/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/6Q/+PIbBdRnHiN/Qg/ph9WUlihaUWkxlw2ntfqtGFOhEor9FvfMF\r\n7h068S/G7BYhvQhWgwW1jflJwBG+ZqHYUGELi8xOMSXTgmh9I5Rn0EHQL0tb\r\nwcms9UcIgokD6Iutrlac0An8KpH6GA1KCCtB3kex7dZsLiO+gXF0h6BONrcD\r\nkY4gAtogn8F/56XCaLA2soe7NrcFndEE61ZUGowjKsDJ1EZWnaDtOlsDV58Q\r\nZcD1OJDC4wcOI13Yu3TRAn6pM9fAj2NmkiwGa9N+6XkWF6dthBrC9esWYaip\r\nNbDjw2FkVqG/FMXyygdwCXC3WuvtSgccDu+ei0qh4CaytL7/3YyqZYRFO20h\r\nC1NxPjJUByf/uoDudPdubu2va3dxtuRhXABHJuGaMglnKTJlRLenER6z5HgO\r\nEoYJhZRZxhcUZod+7qM/s2BSYPdxv3CAaZCW5LA5vHqi+yv8n76/ahToicgM\r\nmdvTt6kZl9etUYkIZdsvgxXCWIivXEIIl4XDKLrYRkAW63eTcwWEasJOggqj\r\ndlVDAf9OrsIOL9FfVHwUxQl8IZTrXfQG+9COqwWDyCVaDJr75qSVTbU6DV3P\r\nxkYaeC7P345pFumnahnFxjJwANVvDmNxqbMNQJzPNaSVEH9sXW5/uQ3B96Mv\r\nEWVJR8TDdA6qe34JXaY3+FeBIFEl49A3lxc=\r\n=sKHZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"e944c2737f6ede8187b599509961f2314d2534c3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.6-beta.5109"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.6-beta.5109_1674938878895_0.1970087901198878","host":"s3://npm-registry-packages"}},"0.15.6":{"name":"piral-pwa","version":"0.15.6","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.6","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c9683c8dc25aca99ad4e9c92588548619d93ad77","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.6.tgz","fileCount":40,"integrity":"sha512-gAQm9D3/Jihpjnsygi9tk8CncZNuXrgwCdKe5eSINZ2+Q8080oLCT8Sz9Mdkb1zkG7i1MtaSXzba5ohLEzxV3A==","signatures":[{"sig":"MEYCIQCBLnKZa4Ifk3k6iPFph++2mKtt6HMdZ8Ya5zZoEwoTTQIhAOn/tNIg8GnJh0oEEQvngw4+QwsKpkauXZH0JFaE0UGu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj19JeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqILxAAh/9e4xSYPUvZc+PNl7T+ulwrLaDyGTLoD7fnXSLm8N78UP3u\r\nPaRoRenqSmkUB10ofQzBzziN3axiLFX4eXR7I1UGsdSt+wcIAbvaq+bO8OYO\r\n7AmCfsb5Ncey44tgTXmV6Wy1GmAStkNJ7hF95LBTjk0IcjMmdWaOLUGuNG6d\r\nh11kHJ5FiCMxxBzlBUQQfanX9FoLqhXXMGHV2EBLoe0XNG3VCX/v/UlB0RA0\r\nH2BAXmRDdhPvp4sSF9j/yHJ1K/sUtMbt0F+9h4A+1J1DEVhJ9kHgx5UfjQCs\r\neynjsUlH2kmBZ+HG3UlAPceYQ9zfvhERqSM4GLSxFA/cq7UAJcw25LJHKyJz\r\nV25CWUS5V9iPxkS83mr/+xQu8dbV6nflpSQcrI+yIMl30XOusyltGCAlbk2z\r\nuNp7RT6OTu8uF8wKY6X4rrzvHwwso0zBNevpxhGfB7io8kLdDE/dJkJPmcME\r\n+ymkIs5TVLtL5eRJm6f3zYCJJv46GRT5nd5Eevt+pvccRcr0RF3Clux5NdaL\r\no4May4nx4hLFitDS+VxmdlbTytkCeXKMhE8AEA186FyAB6mcVxL1nN+SxIcy\r\nomu+f6lcXXVAIhWKWg4yFrG5DkxSCuVT7tSy8WdjHhN+rLu4MLhUg9uNwv7G\r\nHKc+hijiegKdk/o2oRmUo9XWtCRzHu8LRds=\r\n=LAXh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"7e96dd17512148b8363439879f40360c1527854b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.6"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.6_1675088478283_0.9655780883761704","host":"s3://npm-registry-packages"}},"0.15.7-beta.5126":{"name":"piral-pwa","version":"0.15.7-beta.5126","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.7-beta.5126","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ea1f2f2065eb52c4fa4dc62a41a991105fad8718","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.7-beta.5126.tgz","fileCount":40,"integrity":"sha512-G4Hw0tX39zTZlkI6BCKWbYdI5JffE0iZAmEnlc3X4FnLOSqbR2Yhzil3349XXQrh1f3Ka69Gt86/cKFli3olbw==","signatures":[{"sig":"MEQCIHeFrx/dnAUomuXxp3+XV/UGHoOcH5hazRB41Ct3GQkeAiBV0YLp8UeAt4pfMZD5q/yjBkqVOxV+cSnh3boDeIQwgg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2jKSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZJw//ZL/bXm42ZRHleUtcirdXEwJnPasg/6ZLjGGetcSomv0wg5B2\r\nEIKXtP4t8qqVMpm7UnIRba070ULk+MyBzEmqNgjJNSeYoCmqRcgZSaHEGGKt\r\nSRI1xmseNxGmQpR2T4aZvxf+YeM2h4KxuGjmv0S3aYm8n4VoQDfE6y+4IDGa\r\nNISHvIps+/dJN5RGB8lL+kwtWcU/PnyHjPHEagbOeFH0Wv3ChaBAoeX8ew00\r\nkwdTGOgacX7X1kp1PBLKL5JFt5FRx7wPvbrAF0kieD4GsJidWESSsxTm34yg\r\nWSaivMjmXaiZCJqvONhDpxkRwe+J1Yv9UqlQbb0KfO/mhGColOKENzDZ/+CC\r\nSLv9Z5H3nInbdnmoHaYHKZw2mzV5amGTOPX6boUdm9rbL7SKw9iF6/qjGxS7\r\nTAyABXa/VXYcLnfi70bi+J3zo1Jgvdj1N4XEjheaQwWeTd8XQNo0acWaIzvK\r\nHjDpwbxHBNt1sL2Mqv115WgHW2FzTrbITiartLrVCiOLOVUGfZNL46G3E8NK\r\nj6TBfzUbpYGY/F+Csorjvl5g7FuaLAmX/PsfS7PuNjz4kKOIPTNGcA+FT/F3\r\nfQ1F85h1Thunmfju5FX++70Nc+LS91ja5diQm2m99kS0BnqPq/mTjadyHSpy\r\n0AukmzrVM8JReSgadX1yG2twbg642pb/55s=\r\n=7WIp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"e23df08a2bcf0540974ac610ede2c9030fddcb82","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5126"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.7-beta.5126_1675244177940_0.3020433501538371","host":"s3://npm-registry-packages"}},"0.15.7-beta.5134":{"name":"piral-pwa","version":"0.15.7-beta.5134","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.7-beta.5134","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"46b59b8278734fc9737f44abffa23b84e1d9e14c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.7-beta.5134.tgz","fileCount":40,"integrity":"sha512-fVDim4XEhMcHYWwYPZhM3f3jWi8lWW2zMAPquNDw0X8bNiKTTwT9+gSMPcjmnau0EVs1RsP6i4RWkVfprWytHA==","signatures":[{"sig":"MEQCIDHtkRqMCJ+j92QPu4aH+lSLiTX/gYLkFBRylUoDtr3HAiAMTJ4hVv9ehiUU4hBDS4b4DIbW6Sbnh1J0DsLSfW01BA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj24KeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopdRAAgCBiKxvcEOYqufRLnYIz2WFrSKLb3IVcpz374FaArHJ5VhWz\r\nYlSDwlfgNPDdG8NzAkZ2pxvBJAqUzi8VDR6e6C0rwvtE/Ov9a+9sG7TelbLL\r\nnGOtBlWrOqDeIiYlUKawLg+9Fw5Wg/oatg48Bsz1a4gERH9C06yd2UF+WS/6\r\n3jw3K5xTK/EL3AvHK6MGxSkczUxQso5ojticOY3wN7QTq6xuFu5ByNxncoOk\r\nCK8ZykOSZotQSxKeo8+X1IbcT5J3x28Rr8+tiJ9MYgxWMrIFpvPH9frlf8gv\r\n/zuXnYR2RwT8hDeRzVzkgECGDN+yzYN9hdRGcJkpVhaii3Osp1pssFzpAvN9\r\n4SuvTd5bKfHgb6eLI5hL3qMPKG88ZlSrcqvmpgjdQMq78arFikhGwESzAuHR\r\nuvxoMx6tHmJ4IPH3Wi9noYLM6cBxQTQt4+hOmZ5pQDeOd3xgO28NtErCOP2l\r\nPpYvYm5ykin0dUcQpDzrLrafEQxjQ1nBzYzcbS02sbiFxlRXjmnygNacRqVn\r\nJIEyODgwUL+IP4MecHDOPwt3a9SkYqhcX3OZgsLZ1mCHoFcmeajGYP/cwK26\r\nQLOG3N80FSVxczHUwJsF+oytP7V6sOpYnc2UeaRFnaOuw5A+Uxmo6d5/Fp+9\r\nvMHN9ktIMwRfPmB7jJS+WfHLbFYswS2ZSFg=\r\n=fhk6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"9741d20e4f4f6c6492ffc7b40012f7a1b23cbd24","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5134"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.7-beta.5134_1675330206360_0.4681882307521992","host":"s3://npm-registry-packages"}},"0.15.7-beta.5135":{"name":"piral-pwa","version":"0.15.7-beta.5135","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.7-beta.5135","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3bcc83ad67e0728363890ebd869b415c8a5ce015","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.7-beta.5135.tgz","fileCount":40,"integrity":"sha512-TKrNs7QTYpPJQogVOMbib3BX73Ss/aRPU89tKjfKhsRVlPgMXRcCFfRdz7rw9b78BzqC0JFfk6h4nvLTLk3EMg==","signatures":[{"sig":"MEUCIEyaSrM9uiu0LDWxc4Ijg0RkfKL+e4w9WisQONn1DJdCAiEA0r6Y9xNAOObAkM03aRtV6e21PiTsghY0wZj3zGGE7iE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj24MnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYOQ//fyST7NZHPgxRBny1fVYuLWdR3qHZsLjVaqAYGOA3T6ehlTaT\r\nrb/yP6j+3KtjX3UA23bdqYZSLpgrzxPWSY/Ab+EbolPJjw0yuolXwsKHL5rd\r\nvmC0c07Hiq7OXT6+OZGoTt0f/atJZFAuUHEuB95Icx/dC2lpMofsXankm+SK\r\n7I//b7uYwsjHkjK8Sqh8ixWNX2iT9XJPufIvGII/ULMWGVimhR6iuQ0s4Ing\r\nq9iq9RVMqcjw9rzGZKVv1dgfXwIrVZJoYU+RyakSYb3zrWIQxS+I5fuYrYMC\r\n66ppOVhWyQ8ttuDiBqtZDvfMyuMK0UUB/QVopzCRez7kVtTmUQgkViEvGcO3\r\nDeFSp4pRPQO6XDkbo98z7bMYVKizJ9RuuC/LeIs7tV8fUq2etQUEddx7pOG2\r\nYpF9k4EfmQU88loql+74XR0vNezMAtVPGiiGtWaD5v/VaDIxWYmCThGpraN2\r\napbCpCAaljDW4BtQ4no3xT8WRtLFlEX1hDVqBjzq2gO6Jh8by1g7rj75RwNV\r\nPxDgeuhgu2N1VZoVF5delnvC3H4Jx1/UXtW3U72CPl0IuDosmpRi/2BNQ2Ir\r\nqjlFFdShr9sZ6qasNtNmDFuC9YTLLKBu66JV4frjcgja3fV6cNwAi/et4rCn\r\nvfgALpSLJUuAwKpK7SgNiVL8QC9ITVVIp6I=\r\n=vEBs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"9741d20e4f4f6c6492ffc7b40012f7a1b23cbd24","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5135"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.7-beta.5135_1675330343692_0.9846592376997956","host":"s3://npm-registry-packages"}},"0.15.7-beta.5146":{"name":"piral-pwa","version":"0.15.7-beta.5146","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.7-beta.5146","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fe8c9af664cb459965393f33e08d4a0c21b09dd6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.7-beta.5146.tgz","fileCount":40,"integrity":"sha512-DIw2WQt1ir9hQdt0JOO4JMAYs/1L2GF4x9lLqfVyke+U54OrEgdfqICmNrIpFyak1XWT8idwRs5DLDKhQb6AMQ==","signatures":[{"sig":"MEUCIQCzIAWQ0cvYEOp2uTDMDg7Sryogrzo3H+0da2ljVTImqgIgBk3wDglaTKbqr2OfjLh5b24prUgD3rjEKXcdh8itVuo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3i0GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCCQ/+KoFinP32fFIFlwe05m0td4aQj7BQjr1P/f0KVj7xynYrCsPD\r\n8P2SBMGecGuLIEVYTtC2/Oc47lc1+skHVR5uAvnsANAKeYmcuOtP+YdFgyX+\r\nWo4fw3FhFClYfS/qrk1/RdmUA28PSmKsHKRmYo9Bh6TDK4ywGu4C/qsT7w+3\r\naHL2WDgbkWJw+Sx4A05DY0/GW/4vj0a8GPTT43glzy4+h3jx4ZooRX2vJu6z\r\nkANv+yXnLuCtslAhdr4J8pFsY/yM7kXlXheu4m0kJUVsfYcsI2O2wHTEPSrt\r\nPkMYCwPdCpnDLIzt2jyZ68bsZQP0x9ZSmlfUDXB/6kIqCrX5sElC/xNZ6zvD\r\njahURbFYP1Db9vx7nvhv6HKagtVVpoHOFfLVQl7xkKnLtc4HzXsgmyltwOUW\r\nsvwomDNbdWnf8Qms7S9FYxTorIXRxHO/D9m19zIbbA31QIg5z9i7u4/p7cIO\r\ncqKIj3Lg22J+nJITOEleWlk8pPpUQgkpBEvox7IVY6DuB8EZcK4MQ1zm2GmB\r\nPND4Kg41wApMobaNEMt7MgqvyUC1ucFmshCKXt4D53SO18if9Q2Du9l9o2CF\r\nsZVnvT85YrUl1RDI5jvDZFQtpg92L5vw9anyeyGI1GcK7rMSEI7/1KO1uG/G\r\nN/SJXKRZaRl5pS23BHfpcpeENVcYPZZm5o8=\r\n=VuyM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"991e7af022c233bc3662e4017a6b8ea1dbbcbc92","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5146"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.7-beta.5146_1675504902303_0.19367447472456956","host":"s3://npm-registry-packages"}},"0.15.7-beta.5147":{"name":"piral-pwa","version":"0.15.7-beta.5147","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.7-beta.5147","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c6cfebbed6bf682c11bd84a4f75d22183b61e325","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.7-beta.5147.tgz","fileCount":40,"integrity":"sha512-0eTbXatyRTHIUIR4Xp9ncbDdW4U1AB0zkRj2BH9paVxZHStWN3dJjt9kSxZ6wtraBwWRoSM4omNcnsSAbfbTyQ==","signatures":[{"sig":"MEUCIH8ZSGgCp4AuglIlScaDQR8WIFbSkiffdZaiV+zxsQ1xAiEA3zXT6d+Duedvm2CzRffrQlwwL+MQRn1FQypTFN2lftY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4AvqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2Uw//S0LS97yl6GW3Vua01VQtA3QX3q9X82Nz+GmP+hdW+KgfAyh2\r\nV96rOPRzWCqdJCoN5JFbVTMro/DXwnDMcdDrXfh0f0RANL1T00Pfo87T0Yk5\r\nZMreDg4/0LvZw5xE3125ELijoHFK35NomvyJEinZwEh/Pm0GLrW69j4/xehF\r\nuOvjGjj7DeHXUUr1/+32bDQq8DqEE8oBkqZWfgOZeSEX9IkHbLMc6NzBYf4b\r\nrdwTHANgS8yCPcGSqqLao0a19W/A4VRI3FyDVa5fIBeveUwi3FzgW5s+zN8V\r\nZ0QX02YUtqtMZ0SyrpeFqeSAJ9T0CLgHnJObBFVpqugvNvKXmcm8F20rkefu\r\nxYGv99/Ea6m0kh71UyEapFoxY9Up74gHo4+4jTHA7MMMHz5x61fkDu8Rvmxb\r\ngTSJFl2MYOpcIhKzNq3EcJlZdtuSGxtOqbhbSz0fnMgchHAjwSljk9av6Ns1\r\nUnewRnV7ZbMqVKCgv8IE0Ybmod4y7p2NhQoAkU9S3+3KpgkEBGJAuM0L2biy\r\ndhxEmcOBZESRWoZKeqyrPdL+f/5boaR1PGpJKyYI1d3gWS6kxG3xNJa6aWVR\r\nLUmwokKaVWxp+ZCCrod1Fh/mZX1lhYSVzS1PW5BpWYv1PJtHKivTPL0mBb2X\r\nFgmH8eUzAclEWrKMIkbILj2BFYnXB+LVaLw=\r\n=thpN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"8833e0913487f5b11446b6dfdf5354e9154cbded","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5147"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.7-beta.5147_1675627497771_0.262249590103798","host":"s3://npm-registry-packages"}},"0.15.7-beta.5155":{"name":"piral-pwa","version":"0.15.7-beta.5155","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.7-beta.5155","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fcea6efea7fcbd23b0f87d62ca918f1f71fb2f6f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.7-beta.5155.tgz","fileCount":40,"integrity":"sha512-C0cHFL2xHqhfBR1Or+3rfpvngbIwcobB3+5e7JOLc80W1/sBlF3bYr7MJrXv7GWu+qIeDFgwzBMBxhMv12dAsw==","signatures":[{"sig":"MEYCIQCdFwiJAPH6FJgrdq6vHGpw2BXQ0qfJ1JjrKgVWLy3A6AIhAJwYxgcmyVD8iiggUnm+Ntmr3ksoX5FUPJaCihw0u+eO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5PeGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrw4RAAl0x7uPJmQT7zKyKNaD0T4gvdPaGyoPBMzutwsNLOhSRhwlmc\r\nsq7+OxmjI3ZdVPffSPf+4mkZJz7ECh0VwOa7K9zXsPVWYRzzWnt7qhB6H2Ow\r\nOXKb/VJxU4IkeeonFeTBV6ZDUJa1LZ/KK2n5tKr/TCNoG3c1bw9Hk5Gn2wRC\r\n/bkTWZV5GD+2vHKwxvo2BqlFC/oSH5yudvImTOOKzEB0wogmHORxT3dDceAV\r\nEY90EmEXFnLIvGNmlr9nwPysHX+KCwvT38DErZbtgpu3wSsW5zeFsKSjKcHX\r\n1njD6YFJe32BoSmW8ZlhFZ60Vumtkq+O1TTei7xI6LR/SuQhDv2I81GTz7ic\r\nLXFwXdO4m2rRv84Y4Gko+tdWXlItyDRQsgAzR+jAqF5KsKa7llwdnYJlbx7e\r\nuPsTaPrLjs2aQiqu98XDucuAa/XuwHyt+AR21BZZ9iwpMDkugnK5cuHA7xMd\r\n2ZwZOTFI0GcCPy0afDU3Os12fgk9DGrHHpJbfZi0TJ+17tMq+HaGxsXzJTJK\r\nGtCEX1FWekuGI19rJvmHV3t2cotewDuJV5EcxU7quQpdZ53gbyes+7VxfI8z\r\nyf7zcRQHndeVts5TEzXdfLKQ4cVqiXCoAAOvG6fPQYEj0jv75358TPcub4G1\r\nkAEYWV0j4jTJAdP09nzGX/IZCe5z9EPTifY=\r\n=1CTb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f4d7b20a348a2474a0b7c5bfbb265e544732865c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.7-beta.5155"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.7-beta.5155_1675949957870_0.32696856721419465","host":"s3://npm-registry-packages"}},"0.15.7":{"name":"piral-pwa","version":"0.15.7","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.7","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"097320ef4dcd15d9cf9d332ba000c9fe80a5dfc8","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.7.tgz","fileCount":40,"integrity":"sha512-cP53Lk5zbM7qOx/DDMFFi0t/2XFrXG8CD36+YQ3G6S2giWOfkS6VR8SD2XeD83xvmyltQQkHMTa4CUsl6CkwBQ==","signatures":[{"sig":"MEUCIExuTHGWp8hleI/6qqMSbMVn4GS4Q5R6d/TwTUv7ZZH9AiEAhg0wU1md+VgvXb4/2CH9ZsEfUzpZy3EBIyT27EHZxmg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5goAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHIw/7B+mcpsW01YfKJbPQHshROAguB6AoW522pWY/FVeYsxjkTRH/\r\nP8phxyxMA9BGxPqdHIeyAsqNohtdqEl3+tvdKH6J4qJaHMSJeeTALAH5FRuQ\r\n3IFY5EoTY7aw+FDAb7J7mJMflzj2bzbQwQ/fQVelGllzNgLtJLEqjTphyite\r\nuqAlC4OOCyxw6hmbqlU7GWTgFMXEABTm6EE+PBdhZLCoo6Y2EmFp/Zx1Zc22\r\nyuGy3rVQ9iz93Wf9vHOH8G2cnKCnQDEMrXQMm1Sb3cTZePb3KQH9Gfo99pOT\r\nBNBUYMwQ8drfrJ/TGrSJkE1l0LIyZQusAQZMr45U2BXYx9vY/y8z5IKACA4l\r\ndz0anqqujaPnec8GjPbcADulwZC3RmJowNLyzoXKHXmpIC1b2yWtcvs8iSn+\r\nokXOHvvdqhT+dKDfRiX8L3hZxS7Iae88lTasB5bv6yhhSbggIkJo89G7WCXd\r\nTmdMmY1SeZGbJyyvxmRVR9xc/+rjMg4xGIKFiUNaYI4Jsem4B4beBtW85US3\r\nbDe81E3tz/SC8EEq8OGTCwe+3h2qbxb014kHhRim23VSGW0zIOofRYVCkT6o\r\nochIlCFrNwNXdR+E1ilKdl6l+pa5Wyr/D1bkmdUKg5TrEAoJqeOUTXMon77D\r\n3UGJ2nKMWSp54yXDwCupPK9fVgMqIfqjjko=\r\n=dTc3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"79157be0d737c770cff89b1c3a2b802f2b13194d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.7"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.7_1676020224091_0.8395816332090171","host":"s3://npm-registry-packages"}},"0.15.8-beta.5168":{"name":"piral-pwa","version":"0.15.8-beta.5168","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5168","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"fbeeba673ad65667c9422faaad3c2a56adec33d9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5168.tgz","fileCount":40,"integrity":"sha512-Fxjonfn2m4jRBbSjxcF+Kg9HcpumpyGtxe7sBlw9f91vxO2kfkkiioGcERC8tNobWnyXO5xcbZSvVpUZCEh8cQ==","signatures":[{"sig":"MEUCIDAOWi2X21bAfR5Xq7rGlfsQyc9DKikVYvOPV2txhoKPAiEAjwQxtSq2KS+zcNcCTWtkmB1vuJ1X682pJOogBszFcfg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5qdxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr72RAAmYrTV4osIyt50fGBM1Ob66Tgr8r0svv+eM15VhVvu+B4MRd1\r\nPggptjeqzCQ4AJWwCZF2na7WhKajoWvaYBta7c9sxBujZjRzbkMIdeqrhn1y\r\nwaoL3WBZv+eUpaNwbtvZDxi4VklLUAqnc1EPIgapi8FKsDhN7FydchYqPebm\r\nfW+FJBRNAGMWVgqNhyp6qUcpXBFm8wjsvzlRwqA0bSTdDQEDpcD82O7Fmie0\r\nc0ytr+OlO8uM5blEuB3JTDwoKB0k3kbBWfL3QpWy7YuW4Q8dFWLz5RTbHcmM\r\nxMNYCX4/RyVAm6BCFbjaHnwHcRGoJN+MH1IgdoIfYgVqmb5JcBHt733TuS6J\r\nPkBRzu6etLFROuA+hhFFb5yXcnCAQoj2kKo54oymBLp1HpEsaI3b/wLQjzCP\r\nrYe7d9VS9Ecfjr8rRtjrYBPYtLobBoSGpfFjDROIxF9nFbTiGxRTteBQ/OwF\r\nWNJQV/oiNqUeyMgHgQTCitBy0Cn8LqPMYUdYZ00O2PWMO41qTjN2jO8rA0M+\r\nccLBsgXe3zP9fFUGN1QodVAsWiczvRYYoR7x8ExN9L/ey/yXJZfyyWV8IyAU\r\nzRwMV/m1YuUSeeOH9grgE+lAYmt7LIYzNjQUAkIVydzYdi2upBf9yCvdvHqQ\r\nNpOw6sozIThihelAt73HXg6M/7ug5DLKtTI=\r\n=EUNu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"43b50df63d9d3f75b2c07911d8275786157ffabf","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5168"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5168_1676060529168_0.03358436241391116","host":"s3://npm-registry-packages"}},"0.15.8-beta.5218":{"name":"piral-pwa","version":"0.15.8-beta.5218","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5218","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9f6f858f8c06eddd50c1e47849603978f6e2d94b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5218.tgz","fileCount":40,"integrity":"sha512-fTY9jZZzrP38HQ8aaDhUy8qpOMJzdvnhnYFDA9kebjaa8qet8gGkFfJqw6CvZcyqudblG+8fPM5vu/QihhYBCw==","signatures":[{"sig":"MEUCIFHYPpCqWmj+lStRyRKsT6gw5JGNEnHCOBzXt/QnAAsvAiEAldJvCLGF+9BgRKT9z5bkrb3ieKENCRPiG21L8rYtFe8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/41rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofAw/+LUR7pWbPFzzFUZFBfTHl+oVl+Yi7e6sDtOkOgi6i+VNQlw1Q\r\n3Yh2yGkmfbJTrrFO91T0/mPF+Y5PhoOpdIJOpSkcIYVdvxzPKV532cY5Oq6g\r\n8kNI15XY5Ayb9sfnFW8Ta4UA7mPUx+yioaJPqigqKBgHRfXx5AwZyhzVi3dl\r\nWzuN/iF00fqYqTB79r6MMVPXlgyMduemPFXjB69IybeG4Vmq6ll+PXMXCmtW\r\nMJacQmFBslX2+jvQyIr7wQOnHUabv/x8Cx5Zqa+5h3TP4U7gAVfpW8VnyaL0\r\nSrQJgjraMxMbxnpCe/3NgSkhZWLez5n7ocoSftpKa0r8XNs4zf4qU1K6lOdl\r\nY9b7L9s0elV3CfqUohCnA4ZZ7TQfU49It/jp8IBi+5KfHjXNYvAS+wyrPJLK\r\nzlEjh3YBy8Runme2o/wYl0P/zX4326aG4hniaJAN8qGwbbvezyEuyHK9cT/G\r\nE07nUetKY2x6UGkNcPlQuJgdg15TmLQRctaidsZfbYjF1XmXOiOykB7a2VFL\r\nG8OGlpKR2Vxn9nm0vrP2MO1wLB+rM4gwZuqyaduRKro9m5+Y8U1doY3nDlTy\r\nxyAMiMbfC+1YtXQCkcPD5K8cC06djrGVrS7K5wmHxSF3ApVT1ARp/PMOrxwi\r\n+vJQGozjGyZThwNdkA6mP3zSPUnB362ltts=\r\n=y2e0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"d4382a445c6188d31622fea15a6e0e092fcbad78","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5218"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5218_1677692267206_0.5257367304972238","host":"s3://npm-registry-packages"}},"0.15.8-beta.5219":{"name":"piral-pwa","version":"0.15.8-beta.5219","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5219","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3a677782065cacb7a3c2548b3415f8e7f5e48b30","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5219.tgz","fileCount":40,"integrity":"sha512-uwndXMEms9zUirFfjngn0FQIwPaJznrLf0cHSSMYGvEFfhGCzuxN4rwq+TQ5n8zWaibAMHrGuyoXPxbgbtoO2w==","signatures":[{"sig":"MEUCIQChXtOlZAfqRGHdQ54rnLf9gfUf82N2tZIXixmVTeZb+AIgelj/npxd306kFr+84rrMVYGVW0Q6pDRVaxcEbASX8j0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/+TbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrmbw//b2uqGiMgP1xOP7KryJSMQZmRUBN/QntMxSnY4MSlo03J7Agc\r\nRuWpx8Eh06aefCCCR/I5lOwFb2XpqXo0Hq+oV08ksGuRqG4+qwyIKZALRwKV\r\nFB95f6kCC9phHhafTmB7UNNNDZyVC6AhzJh6F1WQxQ5v6keHBp/oBXMszPcS\r\n+Riq56ly707ruPdyRxAcrLbAhT5e4TW5WAziMkOdqrABpWIbbPgVHmVcsA5c\r\nc9xp1bjQKDGzlSK4CHF27e05KaShMd3f6lxs9U2k1I/FXLUWXygzku3ovmry\r\nnbnUZIlWV9M72X0m45dZmrWxMiJeFIHQ9x0AF6x0V09OLtal4TbI700ntpir\r\nPQ3E2O9rzk5+AVPI+YfUKoGdT1B21oOn40336Yx1WG5NrJBCUXeiepanwiuL\r\ncho7/P0yjvKCo0ZP4aZeHXrQCnGVLVkNrDMXAB3LTDipHIII7qQZjrwmM+pk\r\nXOBUX7jhDcCKC83HnHEYwHCqek+oncu3J+q6iNFh992wu8PJHuAxQIKzgFaw\r\nA3e8ZBfDIC+Cm3w5s0/QFlhY44cchG8BIbpP2ipyKFtGoR1kDwHTVX2rVpSM\r\n5dApxMFpVeeZJNz62/pHwsVGkAYrn04ziA0cxvui72+HFJqrTF6iOzbOBDxZ\r\nnT4XyjkuU0aAZO6WAitUIVsFPmVegpupmwE=\r\n=c3TU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"11e6b6a60fe6082d6a01ec67713f3acf85e04b57","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5219"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5219_1677714651529_0.6391407588836393","host":"s3://npm-registry-packages"}},"0.15.8-beta.5224":{"name":"piral-pwa","version":"0.15.8-beta.5224","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5224","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3b38a63bf492b9acbd95b4c6212a0242c32887f6","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5224.tgz","fileCount":40,"integrity":"sha512-oDPxmfBP46pBW+/fY5wkx4xGIZ77XyOpic9MBiIHWPNBVcNqSiZQqClu+6u5HxsYuJqrA9QCmpOn+o/3pGiSRw==","signatures":[{"sig":"MEUCICmKfVkHbaWKlTu3axfDuEqpW4wl2+UAWj5ZhvW7mUeuAiEAgdIPuIVIoHQEQQ8LycaMeOVtNLKmhtXKo5VbjBLdWOA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAKYTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrR+g//dlmNUc8GNRH0WqYq2W+vUGY4zw1/ckg3+pxZy1Wr/Dmtp43r\r\ng3uVpfsSUn8vaDTo76wFd8mIfu4MisE2AG8uu6cxybFPsA5Ro0k/lum+6YaO\r\ncJlN6WMaIZtMT1r5HPA9/+Vo5pnja/a8YMfsXODBFC8jwMMTqTaj/peujv6p\r\nfePFZ7lB0yquR98Eh0Q6b/qX28q8TVi/hqL8nA+Wwl7FCwTK5DlpvGbnfmv+\r\nyH9iHEyOEJVuf7cpJdwFR7qmcI6GQM1+wu82waoUdHb7ukPPUttXluX/9eYK\r\ntuHxsag3moNUX4iZuCP7LcMdDnz5TbSLIjcwj2u0CSUAMP8ZszQDHWpglOGY\r\nmrReKTKlL589gT24v8+qcDKHj4x9xYpCZ0o/Xt+ItJkqtB3lmP4doN0g2vZr\r\nEPycQ4vDII+KbTHuIsB7nrG/+0JdydO+hgA9mXsUtrpmajOBlGvPdFg45mMO\r\nPAte18BJXJWqUrbfHQSsUd4xkDoT3euKHSIw2TJlrIusNpj6SwRzpge4aqT9\r\nmtfw1tqI/IlP+GbTZYu+zNvjL8EBE5Oc3Sa+XD1nLMJZ1n0Y/EURvd9Q+WTV\r\nszuUeR79TY8xjYioBeOhLfWgJ98AH7NxqbL3Coy15JiYqhTnhCh8zFku/TGl\r\npu19AaS74H4+mXeaaJvPLumHyGjZzvKIkYs=\r\n=ts/n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"8bcc3476fd84ace954922e3ff11c394a5b9da7a4","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5224"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5224_1677764114777_0.49479532407393156","host":"s3://npm-registry-packages"}},"0.15.8-beta.5229":{"name":"piral-pwa","version":"0.15.8-beta.5229","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5229","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"3d9069fc38f3c62c722fa0346992ef58d74362bd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5229.tgz","fileCount":40,"integrity":"sha512-Dy+XovzNbzTIkLQQGqNRv5BqdT5Q2dhyeqTzR7MPMizZ4uBm95wsnKQ0UXN6Hvq1mIl/QDYDzaI8YObHgUPiFA==","signatures":[{"sig":"MEYCIQDpjNPDOVp9qc79ZkTtlOdxNLK5nX/KVbbjDsWzPGfKHgIhAP5W1bzkqcGuw3aXEzUw8Dx634Tcza6QNLoDJ5EXeUrL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAOUkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdYg//S12WwSTXvn2lms+I888dluXJ+tLZoC1tbSADjfgo19cs2xEf\r\nDlrT4NrrsClHT/E9+UXR2/V8S5UMBJI6fJMSRtVXmlapeCACdefBe5SJMmAz\r\n4v61XhmIL86SuQrKoj2nWXsGq9K1QLhH3KZflyI4KcqdYCwJpcDNKt5lqX7o\r\nOCWM+gkXZ+Be2Nndu/982XSXgzQWyrhqPOyKUKyrJy/GuyW7kG9ePjqrXD3y\r\nBqY7Nw9Gv6CGafUfaBm6iv3EBemzdZZgSBHLuZVG+uO0N6yZx8WK6PV7HQS/\r\nGOWKoIJ27pBxnho1sqgGeUY0NcJVHn4wdhLzouhUtwPxDvGvi7unCEGBlwIy\r\n/aDiAdWHFBpAQwuILVS8hETVvggdYdxB33AIIh+tSRaHxdAPbBlSPK6p1D5A\r\n3EigLCvNUKkC4KZIw8Q7Ut4PV2mjxj+cWnjFhMkHC9ARBnHmeW+VY7Jy1/c5\r\nxU2MvLBQ9T94dVMQYde3jXM3f4OD/VGYOhh29p5936D4FrVOaNXgFyTsKykI\r\nLVTCtLPkyBa5NSlxx/wGMqUAX/Y2XejofwF8icTt8rJFHYxp6zjNA7yi6FYO\r\nhLpOqSoU3LyFcFohkLmfkqWKOKcFrykzNcUNL3spVy2LhyicGcUu/D24nsqQ\r\n+UCdjD6OKqNuVQVDW90CO+AVEbwbOa0OsS8=\r\n=Bv34\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"8149d15bf5ea66fb4af6f04b6da9242ebd4db1db","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5229"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5229_1677780260549_0.46005378514706874","host":"s3://npm-registry-packages"}},"0.15.8-beta.5238":{"name":"piral-pwa","version":"0.15.8-beta.5238","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5238","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"e38fc2a4c9adfc84c693be3cdc16fcdc7da3df9c","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5238.tgz","fileCount":40,"integrity":"sha512-67bnGyZA4VWMX8stIBLM/UCDKp2vX/b6oqi8VHRqOn4uGymC3F4gh5alaPhNXd9CWhS2uAPuqnRSRf4lP1+/cQ==","signatures":[{"sig":"MEUCIQCUznOMHIs94uQfJojWoiTFtxlGvJoPyV6jG4GJywm6iQIgVs6j1uNa4eOiuyWobyFZI2vhhqueGYp2zaBh/JKaSNs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAbWxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3yw//RxvD/dD0D44LUsF6qDi8gbwOLQn7+/63j9CUCNetdi8Wbfqv\r\nLPRjeEmDXX2Kv+w9UENQcF5V34veQOCKchPo/Q+fIECOOfjwbJ9MtMu1JabJ\r\nDQSNS/wsqctqaX6IWN/ffb+MH0CsgamaUU8Yhu/N90JzjtAHQQfDnMn6AkNw\r\nnVPxXZhIbbbwCYMnOD5kehWtMhpKdo4W+VMTHMLzqanWHY6uKvivjsf/cONG\r\n+bHbZ1O40iRYW0eJa94IPJu6eI2hidkornVpCd3coUbG/6IbFs4oboFhtsJ8\r\nNSelDFu3B1nXnUaYwSW6UibRj7V8L9nDLfg+o7U2BEetKrseSYa93mEswwIx\r\nA9Qyo08DNWmfww42bsc5MWAh0f+rA3DQQfCrYJrTfWFYL8CX41PxoylM84Nu\r\n5g940jjOvOzbN9oi10iTCHf2ZxbT8G6IkQMF+4X3HZP/2rTwjNWVjdkGYMOw\r\nDIft7Ksf6zJLs42jX+y16sZ+aSVIhy5pvhRl+3ErXvqjLP1Ac8b41YSFR+Rr\r\nGEvpCNXpieDBMDirsk55rx632d2y8vJ2oYUl7RVdXftSfDJE3unO4UiCTfTR\r\nNXEpHpDMoLipigiT7blzGT8Wiom08WfxwiG/JoDcXUg7GqaxElOyEVBpr5Ym\r\nyN3c+E/n4vlnjkvDat/RAxsUnR8T6kTytik=\r\n=kpWn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"98d5d39c29ab4a76247695b78c9e73b6086bd09b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5238"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5238_1677833648845_0.25268058658406956","host":"s3://npm-registry-packages"}},"0.15.8-beta.5261":{"name":"piral-pwa","version":"0.15.8-beta.5261","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5261","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a07525df78120e8e5a265fcab8969cdc3c0b4350","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5261.tgz","fileCount":40,"integrity":"sha512-WiBiJZ21z5QUuMfeT2Lj2g6al/Im0+ZTSec/62EO9Ui3bHis0EI6WwDB0DQm6ZNj96b/FG4Jd3znD0FXmoe0Ig==","signatures":[{"sig":"MEYCIQD5V0XLAjz3GpFdA2yHvqs3d8c3due+FcY2ct5SfPA94AIhAIHXuTHwnHZJh8/jZH3B6llQEsWbzlNU3gKbqRenGrQu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBg/UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtWg/8CkfFSkwqCW9YqZwLQT2df4u2dVTHmarQ6BSOp2XsAWGNNQY1\r\nMHpbmS9QafbsN041mrOk9vvMCAYH7Ffmb493ysjrEHHEdTgadhKgBmP4EyH1\r\nfU8uQ6kaSWDzzPO9n+aiC0Soa2hRyhjl6moRQl/CJWhTCbVVLfn8wuUFirTc\r\nk2ujZiLinnExZG3fBdVEP6cPibRjZpW0VvwRgl/cSc1P58MOmJPB6g2YwrAM\r\nLraPQGU1b9a36rm74uCofDRixsouioJW3t0AK9eoDMce29gsapR2MeIVPzfc\r\n1paVEG3txwB8mLFhAaiA4Tx1O7ixiJcXhrqdHliTD4VFW0llP6o0u6zyeWha\r\n4KQgkB9xh0slQqqVHdufnldwaizGeZI0ZOYQbiaqMO8ZLd1JAcJEpCkR7lCY\r\n+JUWlFUfldvAAoMbn+QwEIKiYIvKIq3SzY68iiPHoQAJ3B4V1CWDxCZw8iM/\r\nSV0bCzlZMR1ioyQnEQ6ioJPKADxODvAfvTi2pKmPno49uFzExp1pWrRgH3bw\r\noET71x/ynu9wSBIeyt4o9OgbUG0vok8QxencO1bEkrlPHbCNPfMFSnEXUrxV\r\ncBaYj2BlSWdQnW00wkyys0X2ffflg8zCFDK3NRM4nbSNFP0GNDDZXd/mZqNI\r\nexEbC722I0vRcQnD5EERaJk21lYC5q9kdhk=\r\n=4Zev\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"cd42da9486d7b22c942271dda8bac0d0625eb92c","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5261"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5261_1678118868129_0.6614540172331882","host":"s3://npm-registry-packages"}},"0.15.8-beta.5269":{"name":"piral-pwa","version":"0.15.8-beta.5269","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5269","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"84bce178758788703788849bfdbf0e84f685c823","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5269.tgz","fileCount":40,"integrity":"sha512-ySm4ABIjyXbQwjF2g6YybDynJbi80XmNAG7h/15eJ8AR/pcv9vKbbzI2OWuV0n3TPTaInHNFgGsL7iUtzqlpaw==","signatures":[{"sig":"MEYCIQDRSBmwGPa1A+WlqjNkYcKPALG1Q5w5OplJXmDl9CSBvgIhAITSqlmn9XFynO56nX96WCbmuOOTg53vPI653p5bWdKr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBzHFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrB2A/7BIST+LjhNCNwFMFSx6s+5v/btAcpgpb9z1PXgKVTkgAl5ajj\r\nig2tuRyeiKkD92oVp5nirhTEvxFWBuD6pDkzunRiTbVTRUyiRhdI1UpZboDx\r\ncc3ZDyyy04VHJQXzExji52btTMTicW5SGREMs774l9rbhCh2j18+1jwK1bzq\r\nqDg882rdrGIEB6A/bXsSWV70sP60h/XStzrwIOguVNaksj/egVKu2W4jlPKE\r\nf8YVtmaeO8IrxFwycbTCGz9/mt5JD1WZpQm7I49t7tQ7N+tjGWpGxHoLn7vf\r\nK3DsqGY4rX4wcnuGXUYGTCFQ7R1prRlPS25deJiz45rot3kItkMs5Bcwsa/3\r\nUKf5ksjsh2ADbVwjMhIulAFkhtiEaQ665MyYx+SRN6eWRAW9wW3xdE7CT7Qf\r\nF60/j64HchVYRb8HCPDctnF7gzHzp2pMFCC075bxbWFL1XJplEuvND74Qhmw\r\nFTqv7nQOC4yN02p9XZdcL+zjdUdZWtpboX/nRQN+wj7FXMEQiNj1jQGaBDhj\r\nEd1ug1WHXJMJNZ5BTBxFS8xImOd8oRWERTwWp/lRZuMLhB3BekDmsZK/Wnl1\r\nRuTMLHfwgTKOhF0sTtszCPyTFXJVB8GpWAi3OKtIHuB0oY5r4bxtzrgQqFOK\r\nMdF0lb8CRi/Vz+dZnu63MO6V4glzAtiHnX4=\r\n=VZHT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f372d7442c3aadc61ffd5951104f084744b2fd5f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5269"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5269_1678193093203_0.45086058202953705","host":"s3://npm-registry-packages"}},"0.15.8-beta.5276":{"name":"piral-pwa","version":"0.15.8-beta.5276","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5276","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"65130e99b64052229e56ee6e3df37f4ce4d83d6b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5276.tgz","fileCount":40,"integrity":"sha512-a6+8fpP2ZIRSesxE8YBj8VJqmSiw/lXYXxaUrLS1rvy2pVIXiYfOYIFpzwYPMeUpyt9uX7uEmpK35tceVQ6UoA==","signatures":[{"sig":"MEUCIFgMaaWNX+gYNECwErorgYZsfpJ5lYYnuNQTgim++gVKAiEA6EgxWoCvq/8khF7O/PK7x6q0XyL+illX4CqakUBmixE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB7sUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/QxAAiFI02lsc7hyxqawEgPFwSC7sEEpFILGzISBCGPoR4HXBDNoT\r\nH+wFC9py4AnBdfFPm6fN0bE5WrzJe86sHhYtixAU8FVY/bW8jxEO8joRKJrA\r\nSn10t1YpHEVoS7KUrinHgv099GYOg3XuIKCG+VueWZCMpI8YGr5g7FA9RBUT\r\nD/h8A5zhLM6TFTPDFWKoxqwgf4ndoKEWi5WBHuvQH/qQ9/v+MLjh0qD0WQJB\r\n4fmAZuDzJJvZ3e6C3NeIQJj24zevlTc1AYCnN8Frj1SJAps95C7T3ps2mKc9\r\nANLXuZwmWhDXxKi0/gJg7DSoQ+LHBz72ucZ2DPhusCYnJ4p1cP+nBBeekmd9\r\nhhmBG1oAdcpVt7aLSWzQcW+jauA1VjKhlQb9vhoH+skTt/VkAuui6o+pMH2w\r\nHuuU8yD24pg8hOvoWIykUdrPTwhsJmDtt+wrUrRQYkP7Lnkeph4nwJIgPqJX\r\nc6MLgI0K6AldBMVbQRoQUFso26CVipA8fniD2V6PyXpDyXn1DZJcm7yigFfJ\r\nm+R9kNej39o+PWtklcDlHOVzRMhLh5SyMSnLxDcOG+JgNSlonYquYcj2HvS+\r\nYeV6Hqy+ci7XAlOGv/GmCb5dx0gdzqK28I8h5a9DwqNqrcJ+rXfC49QgV7a/\r\n/IPN5dcGgcqWadjrHX0O3e2dejOieEh4AXA=\r\n=Rq9f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"1718c338ffbe4be963c8e70c1265e4fa56d5a1e0","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5276"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5276_1678228244260_0.9257664680083799","host":"s3://npm-registry-packages"}},"0.15.8-beta.5281":{"name":"piral-pwa","version":"0.15.8-beta.5281","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5281","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"41eab1d3dc4b06d8c6b7bd849f6db8ff4d2fceaf","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5281.tgz","fileCount":40,"integrity":"sha512-w66IguDCfskra/uZD3qlrUw4W5h5FvlHKOLdhJQbUkGY8OToz+oyxFg7TYZfzzhIMQnUBev86wkSCsXUrMl8nQ==","signatures":[{"sig":"MEQCIEkhi1YGkBykKWBK3m3G3e1mx9eY/oFhmv2+ymdptFhzAiASeV+PC2aNqlRQT3+xkyOE24sXHKWWF5tXplF25g3x1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCEU2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqn0g//WGK6TXlpkJImeP67OACfWVdny4FiqrBINrz5A7D2En2qemWA\r\n7tmu515snJ9p2G8hlMDY8EUexv1Y7yJ3uTKGUlLDlPmWNCBorUDjkBJaYQCW\r\nqYH8tnXOb9EptLBPBvB5b9MJ7V00tARTdjFqgESjY8IZ8z8dAqqS9oZXPZhB\r\nWm0wZktkR9Xmxcpz48yPjujdTGkMgtz7odDAqsNdyo/BxgXjVlGv0NkcECgQ\r\nb80CogRApWD1q2xrO2/aUKM3NNVR91Ey5Q4zDjcrm2KMe6yk423WawANsB80\r\nj3RvIFpxLkklKqvXk3Mg4JxCmJslxRO0Zi/h19V/2+UvVkUbnmYufIc4UIL6\r\nj2/esFUFx/wVf04hoLHuHnxtKJcqExzTG8Qj/QX4rrsQSY5PFqeif8kM5BrT\r\nwJD5uup9/t4fG8aIGzGZAr2tAyMy5/9WM4ckt/kv2XG/wkT7vjVwrrzOxd4G\r\ntFwceNPts5Ub4cf4sYgwPdj8sIX06QKp8sFI4F8flLOSuUWk8RsOtKtDOADl\r\nleskczeM6u3rZH3CN9oZMazkaebQIjzH9G9SHpED9m2qPNSxckNspZHe8GQI\r\nk81ubf6Q2iQnj4FzrYAhkWsIX3IByyN/VDzn9NIARhMz+DKzuxkRlnyp7VfH\r\no+soyu0rnnDv6CeSSUCBOuMm3jQHuQGMlNk=\r\n=dpor\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"2e9e94f7a6e4cab98bac439ac9faea95127a00c9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5281"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5281_1678263606511_0.0671139618845904","host":"s3://npm-registry-packages"}},"0.15.8-beta.5283":{"name":"piral-pwa","version":"0.15.8-beta.5283","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5283","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7197d44d847f1d6813f152f324877c733591eff9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5283.tgz","fileCount":40,"integrity":"sha512-OBe3eNaUsuxFYVsOUKYxg9JP5iDYTSiAIQVw445sxr+kB5vbAPpftXyIE49vrmD6AHnC/N6dHJzF50qlnhw+QA==","signatures":[{"sig":"MEUCIQCNQw+rBhASgqyH61SCkvleIj+hMdzqfYgf8iOkmw8GOQIgTgzsvwF5pk4LP50NUNhLrrM89vNwZ9wpe+/pndfNqCQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCEU8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYjg/+KKOI6l5PgjY2zKQrMZ5tLeu3ataVUXBpAcKV6jK2OsaTw/oF\r\nxX4WT/ppo9n/F9jKEAkAj07rwoqJwZcVfzo3AVzTc+DdS9aKAW5ni7pJ5q3o\r\nUhfxRyfsRC5cKT5+exN1hKFhTxvfMp4sONAIH8vTHxWNL8qYDs8KrBw2sCyP\r\ndOSp7B6jVgw3ztHJHnRI+/qtPnP9tJ/wwUgtdjBbepk36v1WTpbiqURWSmhc\r\n4Bs0l5LK8PVdjRNUUaBHOXZt4PZTYDKr7eW4IlD1WxXlQtMJE3SqqOQ4rlcr\r\nsOoWo3zAnr1t4P4uPQ0loGMpCSeR9KFw7fuNA5nWtzJ+B6iXps3Y8XLeRLzz\r\nPyEbDJkAijHU3j2EXc9TbCcwcACffTwYaDFPDRcblYJtVqdiuLubGuLyl9CZ\r\nxGKQS5QKbBBIUOIWttBl1CEtKz2+T8Lc0abKX1MT2+fcHyU71t4nNcn9dXDN\r\nZ8Zj6xw1ProtN4kmf3VvhMKz2eXex2uR0PwlxI1BGo30ASXB7JAQ9VrM6/Cc\r\nBiFG+ay1I1qHCOelwRSDtZIQLPqW3iv57EAXWs/Fa/G0Q5AoMdu2qCnF+ALz\r\n3P6dd/FkE+m7OqVtB0Ciw3xE7VGX/Rl1a+duf/AvuZJ2sHX83fSsSgXR1/+m\r\n5L1pUMjysNgeVXM2eCBxGwAiD+toH+cAh54=\r\n=VQ7v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"2e9e94f7a6e4cab98bac439ac9faea95127a00c9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5283"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5283_1678263612661_0.36982941914510703","host":"s3://npm-registry-packages"}},"0.15.8":{"name":"piral-pwa","version":"0.15.8","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"360822deca43d699ede7c6918e1d98f62118583a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8.tgz","fileCount":40,"integrity":"sha512-k/oFDAqMWfCBPdcB7Ifv/TCXT1bvfuOApnMk8k/MPtFHpoNOWiUCnfkcqpCbLjSBvP/Mf4AEHFbSZrSoAmuO6A==","signatures":[{"sig":"MEQCIGQEjI28Id3d11Lu5pABKvEWAW8cFW/M2BNlbTulOAaqAiAMuUXgMAMK8CWFJMZaeDt9/yWA0LgOTXjv3qeXf17Bbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCFUSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrngxAAiLimjXmbFtuLi39moT8SFoEWyb0Rlmibd/sy7YZgY95d/tuH\r\nCvVad+r7Fnnpkj31qbiGNtKMYG8Zl++hJy7tphfcM+jednIN8Qu1qSI9dV72\r\n0CvrAQSMnU5LHtJjT0EBr3Rk/e57uZM4+WFcbxyDp5dJaagdymYAWo5Vs8Us\r\njF2xFsu1QP4WuD89H2zLVW9xbum2qdbcycWHs/XS/2HIwZeE2JXbZtNqTtfq\r\nawO4ijOl8Ouxb7uTyOhlkPHwBw1fEwATZ+3ZYhN4t5AJZfIgo1cLcOllkIWK\r\nTYRzNVhMXQGa8/El8nqko/lcGVXevpW60dut41kgAKxM62bDLsI/5W6RPWyz\r\nsv7UOXvIGtgOZ+D3PhcEWBMBJIHp1MNkDTKoTWO68zYNod8vvG+Dpq8+6cKY\r\n/KTcfRn4VUmBgw0LuvzATBeCy7uIL+3Kqw+50ZK43HAbqG7b7Qvn+p5RW2V7\r\nFO49CEHajenDf9rWXw6Mn3oqw6iChD8Q4R71/eroSLwNOpNOhgqgQ6SONvBr\r\nqbqfwcYi90ES8yYO/TXim/EmNTKip+2PRyDQBPM5hqM/1HuFoWdtnD8mIn9c\r\nv9tmPsMjxDjmdZybVrjfE+IUFoity8XDzqsNrcqLPyFVgx/TqsrrJPLGX4I8\r\n07+XIHrtJR0g1rAF+ULwvIUfXT0tSIWlFPs=\r\n=X5HB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"0d9486dedbf2a368be8c7debf9be8a8f89b8139f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.8"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8_1678267665864_0.9796524759019716","host":"s3://npm-registry-packages"}},"0.15.8-beta.5316":{"name":"piral-pwa","version":"0.15.8-beta.5316","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.8-beta.5316","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"118bcbb9ea5cf5425ac0be2b6e80f8611dcbc391","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.8-beta.5316.tgz","fileCount":40,"integrity":"sha512-u4fRwHlaKvUW1l43x0yCdey4EcHLos8xCOqmn08nHJh6GMf5JghR39150UnbAWjjnDp90tH/zMX5an7YcfcjCg==","signatures":[{"sig":"MEUCICEkp7c0+WcdDqe4OjGgG+SPZabzVGr2PspOfSfHkMoKAiEA5N/85Zg/tqiT6jUhLPfx1AxIq+kg4wN+OY87NkbGWBU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEYEtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAzg/9FbclIttaLjOT4jjz7fukhPifU6RAkTWTAqblGjchT5f3dcbn\r\nCQoxZR/O1w84hWyXQNgMOieN2Ttu36OoXAHve0eBSWLtcaFUzaEnQC6prpxW\r\n8bGonMPteM13AYZ+fUc1PTxNo8+b4GyGgO08XsnGTaPzW+e9fxa52L/yxrhf\r\nVRKfCy5P9yKC1GQyfFukPW+TYAiXcJFE4ToS4ZlMwvy9d9mVkKuktfxrrIE9\r\nkOt4J2y5804S9K0BZ5ls05lOFyLOjfGvqbCadYXTjVtJ5HVwe7A8xMRA2oKz\r\nTwqC4p0w7E7pfbqbPv2aAj87oydMq9KKB3ye7twEYsST/d0wg4Io+90cVPrz\r\nOikRCH9RK1q1Z4erx5XzlouZaUOaqVVyBDnUFK551qRW2EbSrdhOvRTcb1iv\r\nY/Qz3a9b2uDcMSxmUlaLAXUTHXO4hNn9g1y8Co5Hn7tYmSP0o1UzVfedm/GR\r\nLtFJNssyidGQoHz1tXTqgp2nSqwaEFW7ZwUWk8gmat8MuBmV68OAbiP9mJLS\r\nZovYfQPeWKZuZbbMZuXoJ5nsgUxkiLMQsbO4+Qlai9fExZQ8PBrGz6Fxkoy8\r\n0DwpAV0rLpWvgRzxzQb6aTOJLYb0MRkjqw21fdw6c4PcIcpgnWk6rtzeFlhn\r\nGnI5oIDYHBhWJ3sTt5Z4UC5E2DkWpYQs5XY=\r\n=Imox\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"62cf3e403a817c02836c78d987d04d1b987ead3a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.8-beta.5316"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.8-beta.5316_1678868781038_0.44936030242715974","host":"s3://npm-registry-packages"}},"0.15.9-beta.5384":{"name":"piral-pwa","version":"0.15.9-beta.5384","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.9-beta.5384","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"83f95f20fe406761a9e374e6e8925a5ce2374c4a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.9-beta.5384.tgz","fileCount":40,"integrity":"sha512-UYT13YzbjSuYLp175p/prX0HKm8Mx2r+lWzE9TknhEHpEhHbRQL8/HPEnAoqLHPSpeiVmSwJMhjzFokkvUh6fA==","signatures":[{"sig":"MEQCICIR0WizYGB/VYlLo9Ji+MWk3rXn5mO5xZM1fjQ0KistAiAI37ZqCI7cUrqG0F1pX5gAHRHMYSygXCjb5Xam2xu1Ow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJAGhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJmA/+LWlKvgUMLFUmlHkqeb8gYY2HixomK9sQJ4w0dnm/yfo0a9qG\r\n4+r9S7T7G7yZqHOwMpKzTA44QewKR+v0LqqlFBn9xDPNzpok0qOrgH3ovCU3\r\nKAXBf2IdGggQ90ny/WEZNIEZI78VknKBCIC63Ny0uneqmempbyG4FeP7OT87\r\neCNUjNJII8cXEADOSEMFMG5ZaPsqR7puRnWpCpotx8XZCjCLBwkFGu1pT5w4\r\nSLjeoGP4pAowPSXnxhClK1J+TNb+bWZJA3SsEDPEbam04PvxrpXsPxB0q5Ie\r\nhhG0tmLjGuqiNRtKOxwa4qz/J2/T7+STjrUUSF4b5HMhGUtm6TolTa4QgSX7\r\ngGqIPytKSQVg3KE7LqvV/ta7h/D5vbJx8bbhPu/9YpU/T4JYk+3m9uz/UYI/\r\nUyktS6yZO4iIsYvgMVtQps6m9oSQqed0Xa2IwqubZ/Xljc9ueCVsGIP86Tua\r\nVX5AxEOuQxPuH0lOEF8BvHFD9aVWq9lvMnoI8vX8q7EQ7l1kMkSkBP0rtj8D\r\neYKJ4egu0OngTY6f/00dcKbJD5xuG+4Cs+S6twmLftAN+8Smw26JE2MvYVqx\r\nB4XATXwJpKD66x9S7T1WwZjiltFxuSsJbZEHo0hyvHrdfs3AuPPA5C+5eSSB\r\nJbI/8S9J3gOR2wLvyYkw570LtUGwyWXK4Yg=\r\n=Okrt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"e1fc7342dedc2c0b0f099823e15d9e5ac4c641d5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5384"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.9-beta.5384_1680081313089_0.2824936335764421","host":"s3://npm-registry-packages"}},"0.15.9-beta.5387":{"name":"piral-pwa","version":"0.15.9-beta.5387","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.9-beta.5387","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c8f063699a67532f6c604b6a17f346400d40266a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.9-beta.5387.tgz","fileCount":40,"integrity":"sha512-wuFdV1oYMABkTaC8HFq5V6Z0WOXpe/D06jjDT9/zXFmt0b8kYfHAoQgb6+9QxhI6qiQbVN4ZVCQmmzjprqAU/A==","signatures":[{"sig":"MEUCIH733s8PndCPD4sh20Kve9ULXlRqEU/M9psL+bV2wY7ZAiEAuaP1zPNnHgeXwufijrmySIwp6SmimG2bIhnXybNW5k0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJTjTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2+g/6A7dGvZsHwBgNPXnKU5zGtafsAoGZ/J+/SupctJS8MSM7afam\r\nifpcnVrW3cAZdWPfWOsl+wJWIRToeWIgt0VVt6UhQhbizMBRI1kKgu9Oasdi\r\n1EaZ3m1OSSCgb70UDmSeTKuCQfaX78LQw3y8rDnuG+xmGoQfrDsRFD1i0aDa\r\nlKDDyx+ktcnthSgt+zmhRDC0bT14rPRwQ+9O6vWXy/aZfkq/79diF41S9ZUU\r\nQxHi4oeRNEgew1TlzhoEG0jS+ji3U6Y12CgIIBCUTH1LDhzyId4368FANlub\r\nodvrLdzCAF9Nsg1/bB/8MbnFMnSfiuRflwMouvhNVAmScw34ec87e8xqH4FU\r\nuNomzPamUD5UY9cqlUsMJSjYc2pRPUVMRzPQteqFaIzuzAz1VZA5WjqLFTFl\r\ncgm+QbTexLYV1vapPthZ8lmlrv2U5u1BeVDldBVwIzfJ3HX7Sz+GOy8gCRgU\r\nQHNfFUVR11SWLuYXwGtZblHI0MdnnMUY5AlvW0HSRfdMZ3WusuM4ymYzdz9n\r\nuwK6Mhf9kyJay5sJPkQ/ImtaM2/enJHgySGJzjNRloTFB5B7Sg15uXwBt2st\r\nwai86dF2hGlm/jOyBUQesEDHhUEF8RARiZ3ahPDZRgiwEtNZezKKR5e511at\r\n03cmR1ehfAvyGfPBlxOEfGLFWgE/Baz/n3U=\r\n=H0dS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"7e8a09cd29f25a8986169bad38e270b95be0059a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5387"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.9-beta.5387_1680160979138_0.6447722268111218","host":"s3://npm-registry-packages"}},"0.15.9-beta.5415":{"name":"piral-pwa","version":"0.15.9-beta.5415","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.9-beta.5415","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8ddea783885c3396d97ef4e9258772c39af32bd4","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.9-beta.5415.tgz","fileCount":40,"integrity":"sha512-lCxlaH0fJLq8JTy8iSqsRxlIyZssSnjtHZQVqwsS+XNVx8Jzuu569H1rLZBBtVyclDVt7+EgNXOqBNhhlwEiaA==","signatures":[{"sig":"MEQCICCq7LOR3969xz1gRQrus3CMB//c/TJvWcdEjKJlrqieAiAG9O5rtxgy4iMfriUhCZyGTUr7WXQLvAQQSxATaBMBxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMJrjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsaQ//UNObp5a/pChrRp42PgoGYoda9Ei5syTeES6C3+UO5EqWEfBc\r\nzLgFwnxdvdzdNzQP+6PpzwqADP4hAMKlFs2tyWC9RxDP7PFppMq3F5gO9fqQ\r\n0tLsag/lVvn+Da9BRSmIaHJtw4tB1x8zcjWAHcXXOlPu1v0VeK+x5t2tFMOh\r\nx5Br4rO4CyyYwjFEt01OGPUJpHzIBarkGefU9KbYzmbAlTssXXfJ+t4uqelO\r\nHk+blK7QRyvDtRhoMfrKWaiZ3FuZjorfynrWHe3ozEamBwOLmRXMp2cpAiLz\r\naXB8fiRC49w/NE3hoBv7NvslzT3NuUr7ls0UbYhYsmPyR19LHaP7POKMIC9C\r\n/6Ha5tRkM7gLVj7YZD08X1lm+SoUoZR8KkU0gVXbENHdALCXHZlVz2IHrX64\r\nhh0ECDa2Yt5Vxdyfgm0+K0APVs7WSVC5nZSHudaiSRZ9Go/us0GYYz4/VQRm\r\nJZWR1CKLAadwqFRZh6PI3dQKhQprqxGYYOWYfduFKyo8vnguRatIhlzX0f1g\r\nkTfepHHf4SBqBhWvLW3GbaZCvBqU3YRc+xix6k78MGa5sADZt0KqThy0qyqb\r\neTN5IiIzu3PZKeJqc3UWjPCwilC/JYm/pkDe4eP3Le+1bOejsdFQvXrFQHXq\r\netm9hE1Oedt1yJRd6DCZQGrw11mWn4esPhA=\r\n=yZpk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"85149fa812581dc049a38da51944099330f332db","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5415"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.9-beta.5415_1680906979313_0.4113003273034146","host":"s3://npm-registry-packages"}},"0.15.9-beta.5417":{"name":"piral-pwa","version":"0.15.9-beta.5417","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.9-beta.5417","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c63050abbb50f177ff59d972d7f85c6e047fa06e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.9-beta.5417.tgz","fileCount":40,"integrity":"sha512-+73G+fNxUduqfrKhqANZhuOni/ZmqUMtrCAKecPyavz1hpR65SxtVrRx7JLYQ+Siovhgmg/ad8jYQ6Dd+OqiiA==","signatures":[{"sig":"MEYCIQDwTVmFjaQOIQM6pMqQ5j46cfnQzgHBGNNEULLNqzzstgIhALelz1qFZGChQuoXAh6g9ARDk9b4dAYWZbzPZZNzYUPs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMVrdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoM/w//ZlwosRRWVM3t/FRW4v2x7hjo1D3AMzfm6xd/nRsGD0pK4gQi\r\nImrgjnQJHOqfeOWiD26EVwft97JDtRHpHE8MzoRYzt3CYO83I1fJIyVoq05T\r\n3tZl8wLin4zZrl+oqKyy05F+Mz6KYod+B8viNEnXWNNmagQfXXB6P+1AV6qw\r\nz+vhVVaPWL2Ku+CQBjxyDU641lh+J7QTRsawDYVE9mTb4/60RFIxrCCHgYwt\r\nmxBGe7tyQdkFNbGoMiAacYfz0UQXtIdbioogN4Ge5A5NWQ30tkVwFB0EztTC\r\nmuV1sq1xy+hYcYXGXjhnVl0racnCKlj461idc0hsQdYEBgtLdtCZulB13lKO\r\nIyOyEGQOs4Jzwl2lY2tL9A6hGtOZCclqB+QRfXCxWYdQ9P9WQYHlXEWUacME\r\nUSqHCVxQzWiZ0vqNeretm0flHLLnW/p6PEm3EgsfJoo797TNm/qB8zOR26pq\r\nVmc+DsqWfg6ZyOwAm9KzTip8y4O/v26rpkTI6D/oubci5eSIBxufPVxXsAkk\r\nhnHqURiRatEQcoGNbEcm0wmzLCc6WlQedG7WM+K1OImKob2FpoZAQcn9W7L5\r\nPrsH4M/zoLrgo61ikpSdtlwQD3LN5lPlxvLqrHuHZOiq6fyJe7lNiFqU+05Q\r\nqm27GwlOeC0UHvSI2ffBp9BqptELJgrkThg=\r\n=jmHO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"dde0a115d916010beb178e29abe04fbe116f63f1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5417"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.9-beta.5417_1680956125583_0.6963645644527616","host":"s3://npm-registry-packages"}},"0.15.9-beta.5420":{"name":"piral-pwa","version":"0.15.9-beta.5420","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.9-beta.5420","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"82108e4fb2ad99f831191bc68cd5b568c4d5a40f","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.9-beta.5420.tgz","fileCount":40,"integrity":"sha512-6p/v5Q2uzb/C5y0Xn/yEfqK2ALMKwsxvuiXgu3lHdV4cBKaXvxt37n1rKOddD1K66MTqkLB/S169IpLjqzQvAA==","signatures":[{"sig":"MEYCIQDvOEo/r2hbbRM4Cb4PzZlyOMRHPzBgTnPM6I4UDPB2pAIhAPCp31x+jtZLPF2uTf+DgBPJ7PJUsYkfghe4UlwnIw3t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkM9SWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2mBAAlXa3sbgNf4rQILIul8Ua5kpnQhV8zZJy+QenUr2akNlLgE2q\r\nihcxIWsqE+kbiEPRKLIGwhsuq7/xg/xmTnwNT/BJ2IBEJjVPHN6HbN7uGpRM\r\nz1E+L4L1tIUS0wjHPLI1gZgd3rHkz2y/mObxI1ZBiw4sDbR3xcKOJjicQPda\r\nncXv52SZi6gnLPM8QhJ9khpztScWnbTk/tCf4BUW5o6trYzolRguy6Kp5kum\r\n3EGpNKYTL0pzU5YcbI4QUp2DkexQKmnQCP+HUJJooviohuxndN5KNdU3b9SY\r\nIWiC6Y3pAmk47M6ErMFd5uKJR0Cuz81wIyhMTVBfTRQpGGEYZ97S3MFTYOZ8\r\nO1J4cFT4r1Knt7WGf3NvIq/IF/6LskhvjhF6xVbJTpF88YjusA0pLiFk0Wfw\r\nbXcmy8rZQC6CI8eRNxYhzRchZEoSakotUdecpZnryQ93iFjssDYnGXYuF5M4\r\n1n07tgBVBVKiZf4PEVJb6WgH7+5xLPN6MH2vWgwGKWuiU2d05ZDzxVVoirO4\r\n7+qf6iQdhtV+p9/g1tmP/7zofVnI+nL7x3a5Cfulo0xzf+AtFnoptpfPDyVt\r\nPzwqPpj5R6K5TSFYGpTIs42JSIle6ZXBnHimglbHvVOegFJaNci7oULMqNbS\r\nw6Gbu4rSSpmT/gVvG11Z4V4UXLl/U6ifxxw=\r\n=13wV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"a4b6f7cb2d3285e0d486c7951ad6c3d6484b11f8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5420"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.9-beta.5420_1681118358281_0.23395877892774863","host":"s3://npm-registry-packages"}},"0.15.9-beta.5423":{"name":"piral-pwa","version":"0.15.9-beta.5423","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.9-beta.5423","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ba5aa2d1e26144c74a99a2ce252f84e449eb73f0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.9-beta.5423.tgz","fileCount":40,"integrity":"sha512-yFoIhDc7MRrhU5sentij/mQaY9KqOGPPSFibzKI1QZIoMdkt4qTHK4TwWX5vJcbGIRnvl2iEop0aZJhV5IJriA==","signatures":[{"sig":"MEYCIQDogB/may0g/l8MVp/fAW42avvzYN+ZgvkQPkWqaCVQVAIhALQ/EXledhVXWjUZ28o8X6S5iuHGczyztkqOupk2v4DS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkM+9fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoI4g/+LM2EwAF3z5LBAlLQYDAVPREiVKuTPQWgaWIiTOPDXkX43UvE\r\n3I/1nMxrgPEGp75tMJdoq96tk7ZSIFFrxgMNUv6QKIGFK3zliYsuUdoxzi88\r\n4AzwQQQ8/x1/8zCFN+kEUJJQPPZuf2JiN8NVlLUUPL/D/dgY7Q35VMGiQGzw\r\nIh75WIogiWu6fzKqJb1m3kDwtk5QBaG+z9yXCCbUFBQLgvJO9AD8GLQmwMUz\r\n3HfuMG9BKhBVqHTa6rm0NY5nLq/ljRTwsvYwngo2e5ytxNFxtq3c96VADNmp\r\njOBzKrEmVMOA+bT+cgLTbLdPD/zNAGHro0Vk6Zz+Sr+ill0GHIay8i1Z65+Z\r\n8e8QY43B1+2CE/9enfn45MBkLXIHAiiH7h9B0pwUQuQN77Wue/aFzXx6ZGPN\r\nxt9FIMfdCiIFKN8uU6/Pcr+GusUorfRgFdiauDeArv1sty2gK4if6BvY6rxS\r\nfABKwF1lgN+BkJriGvnPBa5BLfeajPtttFvNqMm5K4oPTqZ91sbimowUaSZo\r\n6QiKDZq7qEQGxrMxnA5ZaNqkmyv4MQgGh41LzCphnASl7hbJg6s/5gX4d4tU\r\nvy3lRL6sZ/DjfOOtiRbnwsscbVu1E9G+MjRDgEPFrXIVVZ8HZxp6tewPxVJz\r\npLws/fBVrJ20Wvt/xvfr+zO3EKLzYi4XBaU=\r\n=6UMh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"df7c927d3efbe8820ab9ee7969f5b1665a1bca40","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5423"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.9-beta.5423_1681125215136_0.0346450898700017","host":"s3://npm-registry-packages"}},"0.15.9-beta.5435":{"name":"piral-pwa","version":"0.15.9-beta.5435","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.9-beta.5435","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"184822bd60e4d923f29d9f7ad16365469990f74d","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.9-beta.5435.tgz","fileCount":40,"integrity":"sha512-zIjeN2/GWiG5yuQxOEwUEonc1V6k4qn5G/gAGcqn7GvUb9uXnwsqYu8bliEKs0eZbZJ8X0pPo4VkldcaZslBgQ==","signatures":[{"sig":"MEUCIQDmmSv+9Rk6wRjDIjSeyMT8fp9GuRcTtn+Dkgq+9L9Y5gIgEaWDKWZC/s9fbp9ae4DAjvJ8AQor/DRmfOfDPhfJP8o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNShAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzQQ//Wx6hnwp1dOK06muemN4B0sWrSpT7DOTmJ1aIACnP/LC2PuNF\r\nQA9/jaHRxAtsj8Eb+70tRzyKVQKjhJeqCHkzc5yKkZSoM70GfOjWQQlxQeyH\r\nZjKFiHOR1ail6Z6BIE/Q4UUXKTulH4liDTcG/y/Fwyg2cjSQuyBUfNemI2o/\r\nS+PBxO7gelval+CDLKkzyuDrh7m2XyvIYfNM0TWs14piBnM6iiZ0+WiA+Txc\r\nBN/igfCEQnDCs+B2lzUmuoYVPL6+AChXrEvF5sGEgLosAaLTEplNIMF4I3Sd\r\n5sljy/r3EnYBh5UGYTXG+81NmAmNjGliIKi0HNPxLFb9HfO+uhQnJx1hpLQQ\r\nYeikchwcB4epYKupNyxznHEjcEpSv6A46jTrKbSk7HvbbHAtg63F/e5eg8QA\r\nGwJz91kmABwUD13Y5WkUNlu3yJ3zO2Z5mW2fqvzDYeR5c+HI0vUkYo+KYlj7\r\nK4q165V5n6IBIMGJeeImh2IFC2hvIKQP32EOdS+dE2arFW6xFjpS+oMqasHJ\r\n8wr4Zq8BLWp/dS6fL2gy06xq9uZ/XSI8/7QYNoP7lLqT88E7aSHxofEmQ3lo\r\nMIh4895riVZpkL5dAxEbB7r37kXbPxMDoAhgP8VBghWhAFY63IjuEgFVWvaf\r\nw8AIAepj8mYCc8ilUG05xpjbtte3YFdJxuQ=\r\n=x1/b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"9a36cc1b229556a4a0fcd7075cc51bdfd6190fe2","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5435"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.9-beta.5435_1681205311848_0.7297799784987113","host":"s3://npm-registry-packages"}},"0.15.9-beta.5437":{"name":"piral-pwa","version":"0.15.9-beta.5437","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.9-beta.5437","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"f8e4b0d73fa2f69c92cef683d5c4ad002dbd219a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.9-beta.5437.tgz","fileCount":40,"integrity":"sha512-SVgYH60v9WU2IF3uRDZyCs97cq4OK9TkzORYYq06IRZyq3OrBgFBwvJnXElnyGMW/qclQsQYtMdOM8Gx0pFCmg==","signatures":[{"sig":"MEUCICzQCTuX3kXA6Q0zVSkco2vePMVNV/u9nAW1bs6jYGwPAiEAvOKHGeYNvTlPY3X7s3SFhro21Cibo0Vh/TejKMGjAbk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNT13ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouBA//QQta6mZTXxI/CFXMb9GKaDlh5mpjxPNmKcg0Zec2rwnEMFTn\r\nAMgHyIMUUIRq4Hrj+gBsbArMlUZJMimQibVSrHOhfGQ7lGMrBbI3ZG1A27ep\r\nmwPTtxvQXfTqbHXMIa/2XGyPFdivE2W5Nlet2gbM7TrHK3d2AzlxRGTBCHNL\r\nwzF3zMCE7MO/QbbO5hzJzczyg7l2pCKcxcm5E3S6TPrZHW0FdWrfS0yWo0k3\r\nMZ3Sg0H7r8RF/rJWE5Ynb55dsWWKOQRoIJllMLIwVZM0x5XtAFVGmTTlVNfF\r\nbMMYRrSZG7lSF/6JpQ1UIt3+YQZVnrTWYM5XBKzQIJ5QSKZGL0cW1F42Xllp\r\nSYGpvI23OrB8q5hjRmmxkv4+Dfcexc2SpVkpuYH6fI85tfkbaJI1MS5TZBGX\r\nvFQWkVEEyKcWXUQp8MsrV1/vuPs6bxu+pLtqGjVY70MZz2+PAYyKrg4Zb5Ft\r\nmrIKaPyT8M8dJyuw9+XPchlSNINdBITVbSA1dlYPzXHmmuIEAIwlitFzR9jl\r\nhuXhLDCs0op//7jy3/JghtssBSZsSNvV43K7dGUgs34zgPmRZSpnmTyjBNW7\r\nKxADXPc3Xr8MnpWpwzXnYD8b1egBMMFh8FE/Cof70QcFzZ2TwAgWho/ABGLu\r\nSYkqVMcZIyxwg7qoUkHZ4ZTpVaM4g07FMv8=\r\n=UyUf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"f8f4a7e9d40f1867843e52379c9dc29ee737f409","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.9-beta.5437"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.9-beta.5437_1681210743575_0.43657757246540463","host":"s3://npm-registry-packages"}},"0.15.9":{"name":"piral-pwa","version":"0.15.9","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.9","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"318830b6826f504315edb68f04667e8d8b256d93","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.9.tgz","fileCount":40,"integrity":"sha512-IwxMm5QvO9guX51y6EzyrvGFhY+/0ROSZeIOT7ShFitnTutu6/oGanHlb9BsM6CM77Lo3n8wuYfoOeDGz6qH9w==","signatures":[{"sig":"MEUCIQCtAB+fAmarnSTKd4I+E7Wsyk7segB+keFl9sJPkvmJ3QIgfm1OLnpypz8Y9du9MOsSGvnezay32BJVHJ4YnZmQ2Wg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNaalACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqH2A/7BeUhfVl7HSY1K6Cq789uOyzWZBgGnXQAI17khfbP0ZlHRdoY\r\nWcUdTWtHG/QL3pLS/GqT6RVBhPykFqh60Tka4hDtY83WMBUBVKuMZ/wnJyo3\r\nid+VgvSuPxhueXMYoBFv+Rg/sg04ZH4jXYSjxux7IvUDI8va51ppRigBgGXt\r\nyM6NFiSToRZJLkzBco4RB91QMmOuOsX58JETmD133AZQT4tZMQ4/lqVtFcCK\r\nhPatyBuq03BKRS1azPj+3ixzbtNrpEE76+laj4seMTYmwNJKHahV80k8Wo4n\r\niWMfBdjzVP2XZXZSdkCB4bTbnGGZ0tg4njNtkYMRV+bRaA5ALvuOilr/V3eI\r\n3RRaXWnIG3PpwJmIcJOVKjkALwBtl6O1kpN/LgOzmIxN50zBk4UpQMtC36TR\r\nH2UTuW2SvhkyLPLoCT689ZjQyvT52gzmdU21ixd3MrUMKYCbmn13xkr2jcDJ\r\nQBmS5JokgtjZY5iDXEVPG2tcvnxBqNbnhCMGAXJuoNbZ1/BEs1FZzUrJ0tEy\r\nvG7Gmc5kx6gOAVmp5y+KAWbuqIsnt/I7W+CdxzrIh+QlVAHJAOv488M3jPp7\r\n/OTMqICYq7LMR1MF2McYMuN4xm7wWDJZ7BCyb2oZdlwubGI9FyvgbG3y+Scw\r\nzYMwFVvklqjTIlMum9dSd0oI2jRnJJdUCNg=\r\n=qnQD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"aa0d6dc1feda46ee7a459441d6bdee589f49a1ce","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.9"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.9_1681237668973_0.984899072552853","host":"s3://npm-registry-packages"}},"0.15.10-beta.5447":{"name":"piral-pwa","version":"0.15.10-beta.5447","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.10-beta.5447","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"5559da57612df62ed6aad3789f261c1a1b2246a9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.10-beta.5447.tgz","fileCount":40,"integrity":"sha512-Yi+oFoO6y4yHJ+YxG4HSoJfKIOcE+wRl6JsLDYiGEzauNiLWL6mh//6eN5XaLIZuCpG1O+bgNsbrEDQZprRr+g==","signatures":[{"sig":"MEUCIQDMlMJ8g+UvOQZW0zxeNRznVqXTQkem7BShrRPV/iiXYAIgE1LWjNgWdqs63QGdbsNLQ31uEn4WE4myBbHpT5wYW0I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOGMRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmry0RAAhJnIk3is9OJKfowF0q9Wi7cuwy3rHZUnKG+FN3HN3MZ/5zj0\r\ncD8/go0aM7nrRWa3HgKOjTnvatfLUl49ijrP3zFgGvmVjx6VfkfTaUIISylj\r\ndasqs+nnfzxWsCzQmriSJi4n3aKbI6gVMDhx6k2tunfmSNUvCBBurq5uiNqX\r\nVvu5srnvOfB7WPbDhueTzCBc/JIvlUxfIn5JSHwKbIQn4TstGs/sQK0+9rom\r\n3sMs95tAWi8VjXru/8hzYg28hztWPjmueNX0zbjHXTjq9BnpywPQm8caYKDx\r\n7lZJrhmplnXyKkCsREi8Cbolv+YVHKBrL4pZOBBDXm/XjaxVJ8hvnrxOzAGc\r\nk8/cIyb+RVExCKUA58MTZYJNBf3cjcLI0QTXv60ND99EnBbdJ/DcQt+9lRex\r\niwPnfsgiesuz8hclWOBXmiIMicjlX9DoqjQffTm4WEG3nGRaUFvcVIHg1Ayk\r\ne+cRxUNLsfddVzZ6QJE0Z/QLLkFGxHwlfxTemNuqKuJv6nk54t3+XT9SASRZ\r\nLuRu6XeMc0MA3ht6oYOMue6YfVhJb4Plzw3Wm3NrFAH/Dg/1hmJIaMLGQuku\r\nBX+qOc7WEi5hHXQySbZq0vyS/b/T0TCUoXiB27AWZavO3cfftmfuA0uwrsw5\r\nIV5B5P3+mU8TrsnYrtQaf/CfvkaJ3MKLZyc=\r\n=/TPc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"29c46cc421457235e89b8ce4e577b092d615a66d","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5447"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.10-beta.5447_1681416977201_0.3344655371877092","host":"s3://npm-registry-packages"}},"0.15.10-beta.5457":{"name":"piral-pwa","version":"0.15.10-beta.5457","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.10-beta.5457","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"68c06ad2dd222f6c2570c078a455dd87a1a7cdfe","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.10-beta.5457.tgz","fileCount":40,"integrity":"sha512-C1ID1CAJcIgVcAxyvPq/3yJSoL3mrmb7FkewXiDQZn7S0CYJlzzcWrxEXzSY1CN32GrVy7py+HUvxo5emHdpNw==","signatures":[{"sig":"MEUCIQC2v4/jgFDJBqAKy1sGV8D66tfpoePRYmhaiLgDRvO1+QIgQ3bCMNIhWHTA0NPVnB1CCXTU5JE87kpf0FdCxhWPuFY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPP1YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmov2g/+McN8mfqrjQyKbKzK77mQg4ZSA6weHobqZdU4nAFqphRpn2sT\r\nM6Zz3LqNRZAfbApv9cZmingPBNFHlFYE+7lFYlIxIw97wDZzwE6KYMfOwpsE\r\nWLqkGR2yOZHrFNeoBmeE+g8jgCWwi/1e8d37YoSiHWqX3GcNGU/RWEkYtS9W\r\nSterXSRqDombzc4WNaGXzw6u78y0ZpdvnVUgANk3PVLM/OFsuWETjAybcqrm\r\nYFknFihOA5IA04ObtCE80WR8KEpdIo8L8gjEmnAr5MxE8fxvDt/w6MS9AOl3\r\nxqWhz7WlpQgGqfiZ0TIHHyufDGBr6OPstvrveF5b27GQBIxvD/KicYEqhDCo\r\nSRzgC3xJOHJUC0ahA8oQThleLMy9CndqKLokEO5HwP3c7oBoPE7jHJeawugE\r\nD66d7HtPuf/C3ne4dcMcoL+u+TCw7aqpucbaHTobRqgcVu6//ZxVrIkJn68M\r\nThawbncjjZcWfMzpGawy61cxJaXeGmIv+vkzG9NahAV2o6S5lO/dtpX8B48v\r\nhpbKBPGr/ErRGJ6XCsVudCpD5bt2VOeEkS794Ol3Ft8axUZe6BC0eJvIeQNO\r\njyLSxGUHwU1iOBfgAXbVvOavu2FEmyhfYxkvNkQlNRkjOWca9yNHFITpSepO\r\nC4ib/yXsT9fv+n81gdijSadD6auu5/MglY4=\r\n=eOu2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"dd199d0645a2126ee2c5be59d725b4b752eac928","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5457"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.10-beta.5457_1681718616360_0.5471172591562026","host":"s3://npm-registry-packages"}},"0.15.10-beta.5462":{"name":"piral-pwa","version":"0.15.10-beta.5462","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.10-beta.5462","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"81bcad26aec3446ae247edf531488513930b3b8a","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.10-beta.5462.tgz","fileCount":40,"integrity":"sha512-MDpIVis3haDCwzGT1Ugf/LlBoWTG1vo+fEeGfbWjJh6kL7YIbcPP0e++h9794KDreWxjCgD7uum6jO5Ox/7IEA==","signatures":[{"sig":"MEUCICDZJ0AgATcT5sGc147gJRXuMtIFFWnIoWJgbEOigZ/JAiEA7LmSfx9ypnNAQNvgS7GpfJ0Z4ULGOMH7Zkjlpe8YXco=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPltFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQWA/5AUaQKX0l2iBQ0bRcG6BHFq5Tjayw26QdSZgmiJztXqBeJ9Ij\r\nLJOppwYGQneyKnZq1qTB1Rn5ejKtMAND3vlFHP0etb9kZj+MdszIf9R70ZTA\r\n9b/CNx01XsNeRHd9H+siT6365S9e6STQeUx5JTtzltze7dKnCPvnEhi33gpd\r\nu7yzJiZVuBE/XA3ZhkzysOzRBoVbQQ0rqP1iRH6I+27jN/rAJBsr4ZXby70w\r\nyZY8xlW7i/O/ToY5RTsiAo3UfRXBoybVFGjwDq5S7w2RYY+vLzMYaMCR/ViW\r\nic1WYOrAzq2tU7WqKeD2NbCCdyw5WhIb3gHTQ+5fO43msCcAiCtJCCl9xeps\r\nJiq8+BcieDY6Ph2EGqDJlsAtZfUE2XqfbkjdiLHMqcdc6k+W4flH8gmqoKXj\r\nBfMpvoTcDju8KNBD3263mkHWm0J88cZSBJ5Ql31398QBIXqHavi/GzjN6H2V\r\nvWSOqBQWA1zDjqpGyOR/jqkA/1s3ami997eQnSKUbS99JZe9tlmXjQWQRvjK\r\noxa5X3EFIW4Dqw/s+dGygVxQc7es5B0L357DAnyRz613Wg+4igUKoNSv4oc8\r\nVodTWPF4yrs6ou7zQ6UN+ehcWBNxcRlvg6a3jEmlbjpiO5D9q0rFne21m8Kn\r\nxDBLJ0H3nTh4ER1qqdG9cCoc+dqmP6h3QA4=\r\n=4bsL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"11acf184ca5d2a56c7f9674b12aed0773489ef88","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5462"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.10-beta.5462_1681808196935_0.7764102026043027","host":"s3://npm-registry-packages"}},"0.15.10-beta.5463":{"name":"piral-pwa","version":"0.15.10-beta.5463","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.10-beta.5463","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"0e39f867e843130b8b0ec73faa55a98a8d8f4c29","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.10-beta.5463.tgz","fileCount":40,"integrity":"sha512-KY1zGmCp3jtIQ6jZf4EY5nyGGy5PHwjN8kzBHpWIcyXP3V6eTWUdB2NRBXMgH9Rw1TPUaO/701QQNi7AKuLdcg==","signatures":[{"sig":"MEUCIQD6Umw7AX4StzdXEIeCfP3kuoa7CNqixCBfBxOXyv5yswIgb+DLLfZryX1n6WFEWo57T+FkjkxpZdCMsNv//YUlYxY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPnNnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUcw//fPWw7izuTrFMASG0u7hiJ+/cbTPvvbCtm6wBueKA3wg32jf1\r\ne77fGDMtqmqo9I5esAUXhiX605zZ4nkRmCe0HGiWacfbjTZAkw35VGY0ohic\r\n4MgbX1jxBJ01RPP314g7rrohgen+OXiR3olaE2XEYlOWJI+Jge33NV6QkBiW\r\ngp3NN5XQ8pAiuYdYyapXQj1IOoPtg1Huu4GauP+5442SAt/Lmiar5oxQUvyH\r\nviUBG+TBf83Vbm9J9JXTcrnSZnatPPlZL8fnunDgxsXJmsFKmaupiOzr1hCs\r\nSOJJaosmR4fT26Xe541f6kIYkW2PqBw+5xyhMcqIFYwChXHMHsqW3pLelwyb\r\nbsQC/KmHSnVTm+ouOjyp8PSasBEbUSvfSerMaCguf6UE04Br7MIEt865u5Ns\r\n5ZSyok3ZBn9dOnNJceNF87F49Lu0uJxO4B5XL8SX77XoyMLvweGBl+qqB4+C\r\nXht9BMITTNs7fdsdbHg9qjyxpImyBfLicJs8bzE4lsdLnV7Pejmpu+e1HRX2\r\nNh45n0aW0s+Q0eidxA4PN+s1un1YSelMlyUOgun4lM9JNOeA+ISl9uxCazC+\r\nkMfMM6y6xBAZr8l5to+tZkcFa8rZrjBgLEqgqq9ogKuy4LSY9Ib2/t6VhLz+\r\nUThmx79MOWuwFzbvA7g4TrkVVaHo9x0/LIo=\r\n=TZAV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"49f28a0509531a5f15c763f1d66a4aeb7b8e823f","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5463"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.10-beta.5463_1681814374872_0.34368345051397076","host":"s3://npm-registry-packages"}},"0.15.10-beta.5490":{"name":"piral-pwa","version":"0.15.10-beta.5490","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.10-beta.5490","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a75576c702c51c03b34e413bc00c8e1a11778cef","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.10-beta.5490.tgz","fileCount":40,"integrity":"sha512-/+EIubeq78+Q+mLkM33dA2Lpg57jlmJGCSXAZKLUCfUofa3Fa/HCxno0C0c8YwNiKKTav8L1Kb5ZYTcH3mXbOA==","signatures":[{"sig":"MEUCIQD2rL85tJdH//Il5SbbQSn5wFy+i7bKmxfOQuWf6OxmOwIgENcar9Rl/LWTupwHN7q9DA778dyb0SOtOGJJ4LqH2NA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS5/6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGcxAAgO1qIPj3OVTL11c7m0fZTztXcuCl12RdV+W9moazwnOlDP+m\r\noQLPYZQOGOHhTidsoA1FLtcIuTpZf3mJEt2HjzuEdtVr8X5Z/8h2+n1ka80b\r\ncl4DDmMzU+XIzPnhnkrc+MiiDGlNMsYpcxJ4oIs76egLAYcDQnTP+QR8hqOo\r\nWexUKiRaL2meQ4NQToao88khHNwDmtYmHO9+rjNA70ZaeTAMPTx3f4ChWNyA\r\nBoAFd8pK1RHvycpmphF7uw6lnf8tIQLkdoR1YEkc9mvsYdpWz0PwYCfPH+k+\r\n/aGHc5tI3Ad++GcGXk2LoLivOoJOfRt1CZetH1YSXDhdGF2LPLmbKXio1vSg\r\ngOxgB9TAFFy6uP01euBxWDOm27AbuQgWlwQcbHK2O6sBFcc/6j/Bz20VSIvA\r\n+VQjUKiCK+04BLXhuo+2COAcljP7VxOAeNDb45IZovrkNxOxrF52NtWBbPi5\r\nhKjiw48s8sw5eoNCLqzsiFeJxlfx9a3iSCb0HSTICW9Qdr3WPE9bYsOgX2NY\r\nJJ9uGNnck4HReaaGCMhjRrZTesb1aFFBfOtQMGQGyRelTxVAJftPN6OvFdWC\r\nirUtf/PW3gCVzt4L4dCkOlOiCdloEwrCay/sSVpXS6dWqoqPZwHa1qHHzByM\r\nM1AVYTuyLaYV/W8kleVb3kwGqeBXEfB44AQ=\r\n=73yB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"c275a93204a80a1a8fbc40c266e9256982eedbc5","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5490"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.10-beta.5490_1682677754463_0.144902522517945","host":"s3://npm-registry-packages"}},"0.15.10-beta.5491":{"name":"piral-pwa","version":"0.15.10-beta.5491","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.10-beta.5491","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"770c4bc83f4b6cb161daac500bad0a0051d14d76","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.10-beta.5491.tgz","fileCount":40,"integrity":"sha512-PVHARe5HU5u4PR7ERVCzk09QDZ2pcFwnFU+kc0Np87LzmP5gTqvc+L5FDinpH5tIbFx4odjFFlP7hSOZ24yG6g==","signatures":[{"sig":"MEYCIQCgYkST/vBAXi7o502sIDbAT077cMGsOW/RUcwxFPz2DwIhAOWBoV9co/IMOJ2nQDuKRGuQdamOxtjOly2RJnmIURVp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkS+SEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofwA/8DHYUsSy7bksxQun42KtLNhpDwf0qLZ2mZRxf3fa+8O436+ov\r\n0vEQQSI3LPfLcwh84W6OnRUPvE/fUXDs2vRo9QgLd5Cw5yyzp9ljUdha+O0q\r\nCtlRzaLy4yY9DK9XRSKWb4QHe2hfHY75yTycqqBSgjCWYatrNzXURpudAgBV\r\n4Vwnkjo/MPqdURf+wo3HNoGhFCzMXO4VWigPrplJI3HuTo/0Fuw7we92rod5\r\nCVshicug6QHxWiVrc/kr9S/cfWdQxgJlro0aR6hEe6ZfcorhPxoLHF/hUOy0\r\n4ajKZ+g23o0CUR4X5hxm10ScN/YN2HYBv3qiiV6oS5u5EDK2u/evWNFn5k46\r\nPBkI9Jk8QanByI+OzZOs6AIrUV4mfxL08fhhy7PG4mpZl/JsTa6MhgM5+dTX\r\neVFZeGZUZLSvigsAhnZjdEBRx0UgsjBNC1GoNCVU+abxNg7uJlsTq/0f5dO0\r\nKEpGBgFouLDus/nfAquW0en4Bkr2vh6SmZ81A/VafOB3An5DsofnMLFzSmCj\r\ntU+iKOCmdedcY+iHweC7sTsxAWwZQaebcNiNDCnzmh0p0ShXf1dY+9dmtfC9\r\nZkcENdnfD2u8dS2mgSMRDgDUh4cYYNHfuzOpLGXECjcs4qD1fmrS995loSFE\r\nnNZhC2i4nljYoKrVmxWhpAP5DZ9oDiKC1Z4=\r\n=iC1I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"3ee67d02efb34989f4642076e302e0813d28bcc1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5491"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.10-beta.5491_1682695300397_0.9372554108724189","host":"s3://npm-registry-packages"}},"0.15.10-beta.5496":{"name":"piral-pwa","version":"0.15.10-beta.5496","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.10-beta.5496","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9fad19cfef8772e039f8e96e08184373c6c5bfc9","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.10-beta.5496.tgz","fileCount":40,"integrity":"sha512-xEW4CMS60pnJ4AmFOQ02+mCxiMcXnCk2dRunGTd7ghZzrJRHH9qvKpfvgTaE89TT8fCVDeunekMDRVuMIOUWzw==","signatures":[{"sig":"MEUCIA7BVGjq/xRwCrw5zZPvV8Govxjbz2B3KtHr/Rt6Ld7JAiEAxMddlK/7Espyy6pWc2FP6qxD/+Q5LT1eHFZ0HUjim0E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkU7mAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoO5BAAmfen6eC5wILSasDXe9GE39PXFBIaCGo/2VwSsN18Z+xqk40n\r\nY/zNvC4P4YVRKuvaDBiiMV8sGwlpJx7AGncP/PD++VWEApeciSlKO+Yx0teu\r\n6G9LwTSG0TGa4CWDKhC9l+K57Qp4+wR7hoRSyGvmUe0ZHh7fp8fvSHRjf2iu\r\nuED7Y/WQwkmip3KYcVLxAABHkuTPJtJpR0DbYjYA65UmCTx9yLQKqNuqomY/\r\nrMZisD0JgVjj3t2UoSMyDA9TDcvq65CsHY3GSJoLhFr0qWFShFzfisvXHWov\r\nQp/cnbr8LbRQkR8cQYMySOf6hF38tQmHnOLn20QH3J0M9tkLkFbfDWdk3C/Q\r\nWsKrX8n8uJwROhmULLS7mOWepqD+uw0xv4EV/u70oepYZ/ua9jEJNkiWfDYw\r\nJDsdf0jK0O/3HzOnT0Y7NyWRmNZ9kwpzBGpOQ8yHFizQZIwc9NIAijDD0y1p\r\nLsxs9BhIvAnmwxBkm4nsQYjOvZ472OYy6AF5QTOnZ0jOC/tgCiZaDCxjByJy\r\nKL7JmQZiCUFEL4iDjiBoLWq7sp4s+OeYJ4PRaxiNC5GPj2r2UGTIB7mLmbC3\r\nnTkNgxzNflVP/yJPpaxtlhhcAIR3aoNbpBzCl4/1RebHf7xFJVlMAzvUUPQB\r\nEgashbIAE+qhS7aB5MZZFK2bNMyZGEdWQJo=\r\n=e2q1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"fa6436e21e3115c53329d622ae4c8bf88c62b6fb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.10-beta.5496"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.10-beta.5496_1683208575875_0.6089090586299406","host":"s3://npm-registry-packages"}},"0.15.10":{"name":"piral-pwa","version":"0.15.10","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.10","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"eb15e0d0f76553acae1768e5e2bf67cb681e4478","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.10.tgz","fileCount":40,"integrity":"sha512-NE2LacgcW/oP4v0vP5WH5VV0CvPTI6/6FPmer7wSOMVNCqWzdqLGMHiLODyKNhRXBeIZWgEobFihBHGAq5Kryw==","signatures":[{"sig":"MEUCIBHPR5+ksE6l9d3IItICGV4P2dqYGYtAZPPTGgWfIDNoAiEAiHBFZHV43VqJ124OXOz3n6vqx3jAPNJpfLpaxlw2+kM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60327},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"801cd5b1af1b26664f84294c86292e7b27e789b1","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.10"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.10_1683541068474_0.6379212609286018","host":"s3://npm-registry-packages"}},"0.15.11-beta.5506":{"name":"piral-pwa","version":"0.15.11-beta.5506","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.11-beta.5506","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"869221d3fae699cb91a798d4c742af909ac4140e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.11-beta.5506.tgz","fileCount":40,"integrity":"sha512-m8sAlDJoHGqPpKeiA410QfnytiOAD0Sc2tq+HoFAM5CqVH12wLn5wEOOBzdHAfXWAQCXbzzatzhMkCmUOy5KsA==","signatures":[{"sig":"MEYCIQDMIHIHLD/IdzGrl95RvGREJd7EJqfHO/TZKIXpCC8ydwIhAMGFDMjUIRdLvxLpLXi7v2dHTwZEB1AiTlkwGh6TGFZR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"1a604e1dc6d75849d65f91debd27b5c0518140e8","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.11-beta.5506"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.11-beta.5506_1683811624332_0.9260842688130606","host":"s3://npm-registry-packages"}},"0.15.11":{"name":"piral-pwa","version":"0.15.11","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.11","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"98d58000529de7c5c6d5529d9ca04d08e130743b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.11.tgz","fileCount":40,"integrity":"sha512-5JO+Ta91kcIET7wfo4wI81GeJ8eN6Vk0ofg1mqI3inVep2ssvzs1jD/6ZdZlJpDjf1ZZLse+IqRnzL8UvS/3Cw==","signatures":[{"sig":"MEUCIQDQ60ZXL3J/PVZMW+TA0aIPmih9Tt1a2TGuUP4EyIstpAIgfAJtqCpXDSedqnYLt1YI8R9xTObnmdFnnvhyNbDjCfc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60327},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"513cd05c0234dd02fdc95abb8f391e307f309fea","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v14.18.1+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.11"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.11_1684155561961_0.45421117348170537","host":"s3://npm-registry-packages"}},"0.15.12-beta.5528":{"name":"piral-pwa","version":"0.15.12-beta.5528","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.12-beta.5528","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"8b156efb3a00705e76dcd3f2dc3e676021e4b011","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.12-beta.5528.tgz","fileCount":40,"integrity":"sha512-CnamZ2+pAwgQ4I9q5nHi2Ju1N4EU29pwGscUxireDpYymBfX6RGygSR1/zoUce6hI4bimHv5www0uPisdDCpJQ==","signatures":[{"sig":"MEUCIBNgbTPtooC9JNnGHYqo3/HnOBd8TtMa6e9qRm5oDjd5AiEAmU0c1VOqrwEiWza8boQFUjlHSCNxKJZUu68dbc26YDo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"6d97a2baca7ae3e5fb19a754ba55d44b40ed137e","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5528"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.12-beta.5528_1684281951275_0.5161058282088744","host":"s3://npm-registry-packages"}},"0.15.12-beta.5531":{"name":"piral-pwa","version":"0.15.12-beta.5531","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.12-beta.5531","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ef9925bc048120cb525ecef247383f7fb38f1240","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.12-beta.5531.tgz","fileCount":40,"integrity":"sha512-SIdE+WgnCbdAHcLGU4+BXmpGX6ZN9jb/0HH8mmtUJnVMkf9OQ0XXgrhWYGpSVgVHyabm3XfoyRLAv2KXjxopww==","signatures":[{"sig":"MEYCIQD8CeGwcCYvuolQP3VMNjup0QVEyy5PZEnARNYXEIozxwIhAPtUUaqvtoSl+S7uIA49MdlqDCskucLAEVWgqsqfDEXP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"e305bf2bdfa60d6325a7db20f550b58dabdea245","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5531"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.12-beta.5531_1684342494731_0.8122285238533611","host":"s3://npm-registry-packages"}},"0.15.12-beta.5535":{"name":"piral-pwa","version":"0.15.12-beta.5535","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.12-beta.5535","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"9d0d6c69d74fc730f91de71e55de41216ee57035","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.12-beta.5535.tgz","fileCount":40,"integrity":"sha512-Bx/f0xgRctg26AZqnW5EqkoeBGuxpOqxZXMYOzQfKhxfjYtPFgfz88vBNggooSPJDLk6rdLr+juiqut4+N+waw==","signatures":[{"sig":"MEYCIQC24YNfQ2dip/Gz/5EYeS6mpploII2b/S/B8QG63o78qwIhAODETaN5ENg4CHQcEm2RGMYRIEYUQleanSzJdlW7tgMY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"6decbca12cb26efb2b2b4fdec3d692eea1420cdb","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5535"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.12-beta.5535_1684481066985_0.5030676082301286","host":"s3://npm-registry-packages"}},"0.15.12-beta.5538":{"name":"piral-pwa","version":"0.15.12-beta.5538","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.12-beta.5538","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"24c604f21d30641bea777cae20e9dec732277758","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.12-beta.5538.tgz","fileCount":40,"integrity":"sha512-pyUcfC3k0tCuhkA2wFkAMs7Zi8x8JLQlF1GAGWWKEZtf7LXsJ+4TdXchqtg31bAYWq2vym7MZskRCKwNokR+fg==","signatures":[{"sig":"MEQCICZ8L+HrrwKqzYY7Ia03c5nTd2V6iDH2PrIyv74ySFKyAiAvpkau7OvZD8Vgf2j9ujfJXDxzvCpossYwRKVMSP4juA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"edf6a2b34e37e7d280a949f0955105e07ac01542","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5538"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.12-beta.5538_1684498213844_0.4115095382026681","host":"s3://npm-registry-packages"}},"0.15.12-beta.5541":{"name":"piral-pwa","version":"0.15.12-beta.5541","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.12-beta.5541","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"54456892640f6fc7e1775534c299850f8a47cada","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.12-beta.5541.tgz","fileCount":40,"integrity":"sha512-3VX/+5tKhxx6zz7fXO2fL3el9RfpBfnEV34BvoxMDwWnNOqIkN0hDol6u9+KGNNGKNnok+YDbeVuv6ubEfPNcA==","signatures":[{"sig":"MEYCIQDAgIiBljMx76LKSD2Y6+zsK+voth3w2N1TfOC13ZmA8AIhAN7MF5V4weIbHVFn3AI3sjx2ONzATLaXz93LEWxdgCNu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"9006ea1da868b2647caf6c142af29f568ae76e4a","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.12-beta.5541"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.12-beta.5541_1684513064489_0.8026174639392318","host":"s3://npm-registry-packages"}},"0.15.12":{"name":"piral-pwa","version":"0.15.12","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.12","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"7d087d031136ccd26fe4c0c258e48a378b23a84e","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.12.tgz","fileCount":40,"integrity":"sha512-Hqwt8SENGNIJ6+R+Ao20jlT2YsA5jELzqvjiUY2ufp/VdREqsAf5kmncYVUdrdz4voV6+fdW65cFCEYnLYWQqg==","signatures":[{"sig":"MEUCICPMoLRRFA6W2Byq1au75MpiHdP4UdtjAeYQb/1XU8svAiEAjTG9pakVGP5hUdIFNLTj4qcYPnZAZQAcY+xQ/4NV4nU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60327},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"a0f06e81b67c81ebe4ff97ae593184fd1e0ba5a3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.12"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.12_1684538603313_0.45836303310243576","host":"s3://npm-registry-packages"}},"0.15.13-beta.5556":{"name":"piral-pwa","version":"0.15.13-beta.5556","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.13-beta.5556","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"eb9b8b30070e53d74fca0511e03ddb5ecc42b7cd","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.13-beta.5556.tgz","fileCount":40,"integrity":"sha512-iDuAVz8TpEzsegkTBEcA6M6OdEnLVzI5VQYe+6/F9iGwEDSf5Vmccqj0y5P83W39eaX8rvtxVaj1fCevWvDDfA==","signatures":[{"sig":"MEYCIQD9G0BSOdCtDrdf6qM6F888V3ZfP0Xp6kNiDM0GfUXwoQIhALRjJEfIrU14ap/EiNKbgD/UJ+zXE5kiDlSEmI0g+BLv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"d18c25ab3b042b684687ecb0fec53c2b241c6fb6","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5556"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.13-beta.5556_1684766165269_0.2533810665581795","host":"s3://npm-registry-packages"}},"0.15.13-beta.5560":{"name":"piral-pwa","version":"0.15.13-beta.5560","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.13-beta.5560","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"ca9d32355769a0d31c074af4cce12457308041d0","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.13-beta.5560.tgz","fileCount":40,"integrity":"sha512-flhd9P1WRqNRs4pxliUvZ5t/ucO4I7WbFoO/AUIYZjOEooCIBBmpAjAeUuWC2AwTxbjrhqyDnctoFwGiy0KJSw==","signatures":[{"sig":"MEUCIQDA/ZEWdEstiXHEt2g+2S0LWzg/9S9HJ6T/rX7vNOzImAIgQej4juHS0MW7OZIuvooRzdMiII2O7U3C+IHDwGATzsk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"18136ebf42fac6b296b8afb7a5c90175ae14df24","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5560"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.13-beta.5560_1684931666445_0.3235140064557538","host":"s3://npm-registry-packages"}},"0.15.13-beta.5575":{"name":"piral-pwa","version":"0.15.13-beta.5575","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.13-beta.5575","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"a6ae0130dc3b6ced6a7f418e40579680a2f2455b","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.13-beta.5575.tgz","fileCount":40,"integrity":"sha512-d6qg3HeIZBfbaBp+JLkeiGmiH94uK+7LYYZtcQxlUPEMBfKm5jmM+4SBkV5Z9lUnvrFfE7arGgJgQxGpKtx/CA==","signatures":[{"sig":"MEQCIE22VW4dVnoZc6KtkNvMyH9PAel7ZypKutBrWO2+H+vCAiB+3fcbC9x/TMPx7SLyU3t0S2riFJOQktm8EHDT3Z3UdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"44084de3fbae6c5b7891ce9cbe99740bf74139d9","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5575"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.13-beta.5575_1685117257428_0.919494545677894","host":"s3://npm-registry-packages"}},"0.15.13-beta.5583":{"name":"piral-pwa","version":"0.15.13-beta.5583","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.13-beta.5583","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"04d2dbbdef08fb9407d2f7a488fa987c05efd205","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.13-beta.5583.tgz","fileCount":40,"integrity":"sha512-OViViiVwO6jfY7Sy7YuD3EnQdGavQMN5inkGbrTyA0EvbDcyMHPgxx+7bGXYvVwQ/RPiWvBN4oglDGfAIO1FqQ==","signatures":[{"sig":"MEUCIQDVE9Mq5+cwQ1J6M+4s+SAQvkXcYZ8Oo59KXa9eMcPCvgIgRUhiRF6nsF+ANM/wtwz5wflXbHVVPBb4G9RzdG3667A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"2628b867cc564352d75a019f1700a5acdd9587f3","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5583"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.13-beta.5583_1685364981760_0.9075183258289581","host":"s3://npm-registry-packages"}},"0.15.13-beta.5591":{"name":"piral-pwa","version":"0.15.13-beta.5591","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.13-beta.5591","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"c3e42d2a0a6ec5dbd06042ff6ced437041a346db","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.13-beta.5591.tgz","fileCount":40,"integrity":"sha512-K6loep5bifIzv0EMMweG4UrGbbUj4ItRlxvuqO0Im/zTPUyBtf3Wx6zZwSjh9cFO9kUfa2ANksbpQ17dVEDkIA==","signatures":[{"sig":"MEYCIQCjYfMBINgqOW6IyofDxoj0bgpX0WAuij/1Y07PRErdbAIhAOaJuO2FAzmRc4n3bBKP7WT0ISymdG/YXJNI9aVSpeGp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60346},"main":"lib/index.js","module":"esm/index.js","readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"784a1959701dc0f13b9b8aa0edda2c7ae7c7390b","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"piral-core":"0.15.13-beta.5591"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.13-beta.5591_1685526432776_0.04506403207977616","host":"s3://npm-registry-packages"}},"0.15.13":{"name":"piral-pwa","version":"0.15.13","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"author":{"name":"smapiot"},"license":"MIT","_id":"piral-pwa@0.15.13","maintainers":[{"name":"florianrappl","email":"mail@florian-rappl.de"}],"homepage":"https://piral.io","bugs":{"url":"https://github.com/smapiot/piral/issues"},"dist":{"shasum":"56cffc260109b341aa89e34fc436773609ac5842","tarball":"https://registry.npmjs.org/piral-pwa/-/piral-pwa-0.15.13.tgz","fileCount":40,"integrity":"sha512-NeYp118fXOhgyObDL+2uyEMT3+IcemuTOcr6gPqv3pjsZOG+6FS3he7pL3JzmNL8gnLt74hAl6gXmJZYpCUFEw==","signatures":[{"sig":"MEUCIHT/0ru0fX+NP1TG3NP4n5u+YnPGnNJMq0imSADwEmmyAiEA3tZq9TkPRJfWrs89y+Z4Wu3fchIbCzjqizXk4XKvP4U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60327},"main":"lib/index.js","module":"esm/index.js","exports":{".":{"import":"./esm/index.js","require":"./lib/index.js"},"./_/*":{"import":"./esm/*.js","require":"./lib/*.js"},"./esm/*":{"import":"./esm/*"},"./lib/*":{"require":"./lib/*"},"./package.json":"./package.json"},"gitHead":"1c7ef348ee00d0bfd2d8a5af20bb846d6d88f485","scripts":{"test":"echo \"Error: run tests from root\" && exit 1","build":"yarn build:commonjs && yarn build:esnext","cleanup":"rimraf esm lib","typedoc":"typedoc --json ../../../docs/types/piral-pwa.json src --exclude \"src/**/*.test.*\"","build:esnext":"tsc --project tsconfig.json --outDir esm --module esnext","build:commonjs":"tsc --project tsconfig.json --outDir lib --module commonjs"},"typings":"lib/index.d.ts","_npmUser":{"name":"florianrappl","email":"mail@florian-rappl.de"},"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"_npmVersion":"lerna/6.0.1/node@v16.20.0+x64 (linux)","description":"Plugin for creating the Piral instance as a PWA shell.","directories":{},"sideEffects":false,"_nodeVersion":"16.20.0","_hasShrinkwrap":false,"devDependencies":{"piral-core":"^0.15.13"},"peerDependencies":{"minimatch":"3.x","piral-core":"0.14.x || 0.15.x","parcel-bundler":"1.x"},"_npmOperationalInternal":{"tmp":"tmp/piral-pwa_0.15.13_1685526438600_0.663293548439339","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-11-12T00:29:54.805Z","modified":"2026-05-22T14:25:45.350Z","0.9.0-pre.739":"2019-11-12T00:29:55.017Z","0.9.0-pre.741":"2019-11-13T14:29:43.793Z","0.9.0-pre.742":"2019-11-15T13:04:25.168Z","0.9.0-pre.746":"2019-11-17T02:16:37.481Z","0.9.0-pre.751":"2019-11-25T11:00:01.075Z","0.9.0-pre.754":"2019-11-26T07:01:01.904Z","0.9.0-pre.755":"2019-11-26T14:33:08.468Z","0.9.0-pre.756":"2019-11-26T16:37:42.629Z","0.9.0-pre.757":"2019-11-28T10:57:23.137Z","0.9.0-pre.758":"2019-11-29T00:32:33.510Z","0.9.0-pre.759":"2019-11-29T14:09:54.405Z","0.9.0-pre.763":"2019-12-02T16:38:49.014Z","0.9.0-pre.765":"2019-12-03T10:50:00.351Z","0.9.0-pre.767":"2019-12-03T14:07:08.439Z","0.9.0-pre.770":"2019-12-03T15:02:41.866Z","0.9.0":"2019-12-03T16:05:27.717Z","0.9.1-pre.779":"2019-12-05T11:49:43.330Z","0.9.1-pre.781":"2019-12-06T12:34:21.084Z","0.9.1":"2019-12-06T13:35:59.203Z","0.9.2-pre.785":"2019-12-06T22:06:34.356Z","0.9.2-pre.787":"2019-12-07T00:20:48.064Z","0.9.2-pre.789":"2019-12-07T01:46:16.616Z","0.9.2-pre.790":"2019-12-07T12:30:22.246Z","0.9.2-pre.796":"2019-12-09T01:59:04.685Z","0.9.2-pre.799":"2019-12-10T00:01:09.105Z","0.9.2-pre.802":"2019-12-10T19:32:25.118Z","0.9.2-pre.804":"2019-12-11T00:21:00.503Z","0.9.2":"2019-12-11T06:59:42.704Z","0.9.3-pre.808":"2019-12-13T00:44:58.931Z","0.9.3-pre.811":"2019-12-16T13:46:00.863Z","0.9.3-pre.813":"2019-12-16T19:53:42.698Z","0.9.3-pre.814":"2019-12-16T23:36:49.244Z","0.9.3-pre.816":"2019-12-17T01:06:52.338Z","0.9.3-pre.818":"2019-12-17T14:58:43.654Z","0.9.3":"2019-12-17T16:49:23.999Z","0.10.0-pre.823":"2019-12-18T04:36:39.838Z","0.10.0-pre.827":"2019-12-20T10:43:32.648Z","0.10.0-pre.828":"2019-12-22T23:48:37.341Z","0.10.0-pre.829":"2019-12-26T00:11:49.046Z","0.10.0-pre.832":"2019-12-30T19:05:47.660Z","0.10.0-pre.833":"2020-01-03T06:11:31.006Z","0.10.0-pre.836":"2020-01-08T06:56:33.871Z","0.10.0-pre.837":"2020-01-09T01:00:37.038Z","0.10.0-pre.838":"2020-01-10T10:11:34.631Z","0.10.0-pre.839":"2020-01-13T00:29:13.580Z","0.10.0-pre.842":"2020-01-17T14:56:59.444Z","0.10.0-pre.843":"2020-01-18T10:48:39.421Z","0.9.4":"2020-01-20T16:16:18.058Z","0.10.0-pre.846":"2020-01-20T18:29:33.997Z","0.9.5":"2020-01-21T16:39:27.415Z","0.9.6":"2020-01-22T16:34:54.883Z","0.10.0-pre.853":"2020-01-23T00:27:24.890Z","0.10.0-pre.855":"2020-01-24T00:18:20.526Z","0.10.0-pre.856":"2020-01-24T13:29:26.864Z","0.9.7":"2020-01-25T23:03:44.435Z","0.10.0-pre.861":"2020-01-25T23:38:43.609Z","0.10.0-pre.865":"2020-01-27T16:38:22.847Z","0.9.8":"2020-01-27T22:30:18.078Z","0.10.0-pre.870":"2020-01-27T23:04:05.982Z","0.9.9":"2020-01-29T13:51:11.193Z","0.10.0-pre.877":"2020-01-30T16:24:12.586Z","0.10.0-pre.878":"2020-01-30T19:04:40.798Z","0.10.0-pre.879":"2020-01-30T23:20:44.761Z","0.10.0-pre.880":"2020-01-31T11:01:09.203Z","0.10.0-pre.881":"2020-01-31T16:18:08.209Z","0.10.0-pre.883":"2020-01-31T22:44:50.984Z","0.10.0-pre.885":"2020-02-01T13:22:20.281Z","0.10.0-pre.887":"2020-02-02T07:43:24.528Z","0.10.0":"2020-02-02T10:16:00.693Z","0.11.0-pre.891":"2020-02-03T00:35:30.918Z","0.10.1":"2020-02-04T01:24:54.133Z","0.11.0-pre.894":"2020-02-04T06:45:39.909Z","0.10.2":"2020-02-05T14:24:56.650Z","0.11.0-pre.897":"2020-02-05T22:25:57.725Z","0.11.0-pre.902":"2020-02-07T09:40:58.670Z","0.10.3":"2020-02-11T00:29:48.195Z","0.11.0-pre.937":"2020-02-11T01:05:03.645Z","0.10.4":"2020-02-11T23:02:54.253Z","0.11.0-pre.942":"2020-02-11T23:40:15.348Z","0.10.5":"2020-02-15T17:56:38.287Z","0.11.0-pre.945":"2020-02-15T21:54:27.058Z","0.11.0-pre.946":"2020-02-18T21:53:53.539Z","0.10.6":"2020-02-20T21:54:00.867Z","0.11.0-pre.956":"2020-02-20T22:27:47.300Z","0.10.7":"2020-02-21T08:57:03.087Z","0.11.0-pre.960":"2020-02-21T12:54:02.464Z","0.11.0-pre.963":"2020-02-23T09:35:40.677Z","0.10.8":"2020-02-25T15:55:00.213Z","0.11.0-pre.970":"2020-02-25T16:29:39.695Z","0.10.9":"2020-02-28T11:34:56.626Z","0.11.0-pre.973":"2020-02-28T16:03:33.811Z","0.11.0-pre.974":"2020-03-03T07:13:49.619Z","0.11.0-pre.975":"2020-03-04T00:02:23.403Z","0.11.0-pre.979":"2020-03-05T22:55:58.528Z","0.11.0-pre.985":"2020-03-09T13:22:10.495Z","0.11.0-pre.987":"2020-03-14T07:04:32.388Z","0.11.0-pre.988":"2020-03-18T21:28:29.792Z","0.11.0-pre.989":"2020-03-20T11:40:25.596Z","0.11.0-pre.992":"2020-03-21T18:48:39.663Z","0.11.0-pre.994":"2020-03-22T02:20:50.512Z","0.11.0-pre.995":"2020-03-22T23:16:04.703Z","0.11.0-pre.997":"2020-03-27T00:21:37.769Z","0.11.0-pre.998":"2020-03-29T01:53:55.103Z","0.11.0-pre.1007":"2020-03-29T23:49:21.256Z","0.11.0-pre.1009":"2020-03-30T23:57:07.998Z","0.11.0-pre.1030":"2020-03-31T15:19:47.099Z","0.11.0-pre.1034":"2020-03-31T18:55:38.710Z","0.11.0":"2020-04-01T06:08:00.997Z","0.11.1-pre.1039":"2020-04-01T09:07:38.140Z","0.11.1-pre.1050":"2020-04-06T06:40:55.654Z","0.11.1-pre.1053":"2020-04-08T11:39:25.231Z","0.11.1-pre.1055":"2020-04-08T18:55:43.557Z","0.11.1":"2020-04-08T20:18:20.774Z","0.11.2-pre.1081":"2020-04-11T22:14:41.755Z","0.11.2-pre.1094":"2020-04-16T13:31:50.829Z","0.11.2-pre.1095":"2020-04-18T23:38:22.602Z","0.11.2":"2020-04-19T08:13:01.802Z","0.11.3-pre.1099":"2020-04-20T23:00:51.061Z","0.11.3-pre.1117":"2020-04-22T10:00:00.934Z","0.11.3-pre.1120":"2020-04-23T23:36:14.632Z","0.11.3":"2020-04-24T08:32:57.715Z","0.11.4-pre.1124":"2020-04-24T22:31:19.652Z","0.11.4-pre.1127":"2020-04-29T04:46:33.967Z","0.11.4-pre.1128":"2020-04-29T12:37:04.091Z","0.11.4-pre.1130":"2020-04-30T13:27:21.408Z","0.11.4-pre.1131":"2020-04-30T14:21:56.351Z","0.11.4-pre.1133":"2020-05-02T22:00:51.935Z","0.11.4-pre.1134":"2020-05-04T22:04:28.513Z","0.11.4-pre.1138":"2020-05-05T16:08:38.676Z","0.11.4-pre.1139":"2020-05-05T17:20:18.453Z","0.11.4-pre.1148":"2020-05-06T11:30:10.197Z","0.11.4":"2020-05-06T13:11:56.891Z","0.11.5-pre.1155":"2020-05-07T09:53:56.118Z","0.11.5-pre.1167":"2020-05-09T23:34:37.910Z","0.11.5-pre.1168":"2020-05-10T08:18:18.412Z","0.11.5-pre.1169":"2020-05-12T12:39:55.263Z","0.11.5-pre.1176":"2020-05-13T16:05:38.329Z","0.11.5-pre.1196":"2020-05-15T15:54:29.971Z","0.11.5-pre.1201":"2020-05-18T19:51:43.173Z","0.11.5-pre.1203":"2020-05-19T07:03:44.178Z","0.11.5-pre.1204":"2020-05-19T19:25:49.408Z","0.11.5-pre.1233":"2020-05-21T15:30:00.066Z","0.11.5-pre.1237":"2020-05-22T19:35:39.284Z","0.11.5-pre.1242":"2020-05-23T12:30:22.738Z","0.11.5-pre.1243":"2020-05-23T21:49:48.243Z","0.11.5-pre.1244":"2020-05-23T23:43:42.197Z","0.11.5-pre.1248":"2020-05-24T16:37:22.055Z","0.11.5-pre.1250":"2020-05-24T18:15:35.238Z","0.11.5":"2020-05-24T19:49:03.119Z","0.11.6-pre.1254":"2020-05-24T22:25:09.685Z","0.11.6-pre.1256":"2020-05-25T22:08:23.035Z","0.11.6-pre.1258":"2020-05-26T21:49:15.143Z","0.11.6-pre.1262":"2020-05-27T13:19:20.882Z","0.11.6-pre.1316":"2020-05-28T23:07:05.511Z","0.11.6-pre.1320":"2020-05-29T16:33:22.001Z","0.11.6-pre.1322":"2020-05-29T20:46:09.952Z","0.11.6-pre.1324":"2020-06-02T06:35:08.852Z","0.11.6-pre.1357":"2020-06-02T14:36:05.938Z","0.11.6-pre.1361":"2020-06-02T15:24:42.710Z","0.11.6-pre.1371":"2020-06-03T07:27:22.473Z","0.11.6-pre.1372":"2020-06-03T07:47:10.983Z","0.11.6-pre.1377":"2020-06-03T13:18:13.818Z","0.11.6-pre.1380":"2020-06-04T06:54:35.174Z","0.11.6-pre.1391":"2020-06-05T23:11:02.846Z","0.11.6-pre.1393":"2020-06-06T01:10:29.384Z","0.11.6":"2020-06-06T14:50:31.161Z","0.11.7-pre.1403":"2020-06-07T13:33:52.859Z","0.11.7-pre.1404":"2020-06-07T16:23:48.061Z","0.11.7-pre.1406":"2020-06-07T21:46:32.953Z","0.11.7-pre.1415":"2020-06-10T07:09:46.896Z","0.11.7-pre.1416":"2020-06-10T08:52:02.662Z","0.11.7-pre.1417":"2020-06-10T09:28:18.906Z","0.11.7-pre.1420":"2020-06-10T12:16:40.563Z","0.11.7-pre.1421":"2020-06-10T15:47:45.628Z","0.11.7-pre.1423":"2020-06-12T07:18:27.277Z","0.11.7-pre.1424":"2020-06-14T21:28:38.707Z","0.11.7-pre.1425":"2020-06-15T12:26:31.989Z","0.11.7-pre.1426":"2020-06-15T23:26:14.090Z","0.11.7-pre.1427":"2020-06-16T10:10:57.981Z","0.11.7-pre.1428":"2020-06-16T14:36:15.339Z","0.11.7-pre.1429":"2020-06-16T20:39:33.364Z","0.11.7-pre.1430":"2020-06-17T23:54:55.438Z","0.11.7-pre.1431":"2020-06-18T06:45:09.649Z","0.11.7-pre.1433":"2020-06-19T02:53:37.478Z","0.11.7-pre.1435":"2020-06-20T23:09:55.374Z","0.11.7-pre.1437":"2020-06-21T00:39:34.800Z","0.11.7-pre.1439":"2020-06-21T14:56:09.191Z","0.11.7-pre.1441":"2020-06-22T04:59:09.577Z","0.11.7":"2020-06-22T06:41:01.865Z","0.11.8-pre.1446":"2020-06-22T13:44:07.840Z","0.11.8-pre.1447":"2020-06-24T08:52:47.936Z","0.11.8-pre.1521":"2020-06-26T07:49:00.845Z","0.11.8-pre.1522":"2020-06-27T23:00:47.082Z","0.11.8-pre.1548":"2020-06-29T22:48:36.702Z","0.11.8-pre.1560":"2020-06-30T14:36:53.568Z","0.11.8-pre.1583":"2020-07-01T08:41:44.362Z","0.11.8-pre.1591":"2020-07-01T14:21:56.898Z","0.11.8-pre.1595":"2020-07-01T17:28:14.759Z","0.11.8-pre.1596":"2020-07-01T23:32:43.943Z","0.11.8-pre.1607":"2020-07-03T13:16:15.373Z","0.11.8-pre.1610":"2020-07-03T15:12:08.474Z","0.11.8-pre.1611":"2020-07-05T16:26:30.172Z","0.11.8-pre.1616":"2020-07-06T14:18:40.701Z","0.11.8-pre.1618":"2020-07-07T02:23:39.250Z","0.11.8-pre.1620":"2020-07-07T14:28:47.161Z","0.11.8-pre.1622":"2020-07-08T08:29:04.551Z","0.11.8-pre.1627":"2020-07-08T14:44:06.831Z","0.11.8-pre.1633":"2020-07-09T06:10:09.533Z","0.11.8":"2020-07-09T14:33:46.733Z","1.0.0-pre.1638":"2020-07-09T20:30:55.203Z","1.0.0-pre.1648":"2020-07-13T09:02:07.107Z","1.0.0-pre.1657":"2020-07-14T08:27:53.699Z","1.0.0-pre.1666":"2020-07-15T10:00:25.571Z","1.0.0-pre.1671":"2020-07-15T14:43:18.259Z","1.0.0-pre.1672":"2020-07-15T18:06:25.282Z","1.0.0-pre.1676":"2020-07-16T06:18:48.315Z","1.0.0-pre.1679":"2020-07-16T10:01:49.217Z","1.0.0-pre.1682":"2020-07-16T15:47:40.159Z","1.0.0-pre.1684":"2020-07-16T22:27:51.330Z","1.0.0-pre.1690":"2020-07-20T08:33:44.262Z","1.0.0-pre.1692":"2020-07-24T09:24:35.361Z","1.0.0-pre.1694":"2020-07-25T09:38:03.818Z","1.0.0-pre.1699":"2020-07-28T22:44:32.286Z","1.0.0-pre.1703":"2020-07-30T14:58:17.021Z","1.0.0-pre.1708":"2020-07-31T08:20:05.608Z","1.0.0-pre.1721":"2020-08-03T09:07:50.669Z","1.0.0-pre.1730":"2020-08-06T15:18:08.512Z","1.0.0-pre.1731":"2020-08-09T10:29:04.307Z","1.0.0-pre.1732":"2020-08-10T21:31:12.252Z","1.0.0-pre.1741":"2020-08-21T22:19:36.848Z","1.0.0-pre.1742":"2020-08-25T21:58:43.066Z","1.0.0-pre.1746":"2020-09-01T10:11:27.891Z","0.12.0-pre.1747":"2020-09-04T21:56:28.580Z","0.12.0-pre.1748":"2020-09-07T22:48:02.456Z","0.12.0-pre.1750":"2020-09-08T10:11:02.411Z","0.12.0-pre.1754":"2020-09-08T19:27:36.227Z","0.12.0":"2020-09-09T08:52:12.795Z","1.0.0-pre.1758":"2020-09-09T14:26:53.528Z","0.12.1-pre.1768":"2020-09-16T14:41:31.432Z","0.12.1-pre.1770":"2020-09-16T15:38:56.036Z","0.12.1":"2020-09-17T08:13:49.772Z","1.0.0-pre.1775":"2020-09-17T09:07:45.716Z","1.0.0-pre.1779":"2020-09-21T12:09:05.721Z","0.12.2-pre.1793":"2020-09-26T00:24:27.550Z","0.12.2-pre.1794":"2020-09-26T12:42:26.399Z","0.12.2-pre.1795":"2020-09-26T20:19:57.115Z","0.12.2":"2020-09-28T04:17:18.955Z","1.0.0-pre.1801":"2020-09-28T08:22:56.385Z","0.12.3-pre.1815":"2020-10-05T12:37:42.718Z","0.12.3-pre.1816":"2020-10-06T00:56:32.702Z","0.12.3-pre.1817":"2020-10-06T23:00:35.083Z","0.12.3-pre.1818":"2020-10-08T10:44:30.443Z","0.12.3-pre.1820":"2020-10-09T15:03:01.961Z","0.12.3-pre.1826":"2020-10-09T23:27:33.095Z","0.12.3":"2020-10-10T00:03:25.849Z","0.12.4-pre.1830":"2020-10-13T08:33:29.240Z","0.12.4-pre.1836":"2020-10-20T09:06:40.890Z","0.12.4-pre.1846":"2020-10-21T20:42:41.316Z","0.12.4-pre.1854":"2020-10-23T13:58:23.925Z","0.12.4-pre.1861":"2020-10-27T22:51:39.272Z","0.12.4-pre.1862":"2020-10-28T13:15:45.273Z","0.12.4-pre.1863":"2020-10-28T16:16:50.936Z","0.12.4-pre.1867":"2020-10-30T07:10:01.642Z","0.12.4-pre.1874":"2020-11-11T00:25:38.749Z","0.12.4-pre.1875":"2020-11-11T16:29:08.377Z","0.12.4-pre.1884":"2020-11-16T17:26:28.525Z","0.12.4-pre.1886":"2020-11-17T12:52:15.230Z","0.12.4-pre.1888":"2020-11-20T00:12:53.629Z","0.12.4-pre.1890":"2020-11-20T11:36:02.540Z","0.12.4-pre.1895":"2020-11-21T02:07:59.550Z","0.12.4":"2020-11-24T11:12:34.807Z","1.0.0-pre.1899":"2020-11-24T13:31:02.701Z","1.0.0-pre.1904":"2020-11-26T13:18:48.627Z","1.0.0-pre.1958":"2020-12-08T15:20:26.967Z","1.0.0-pre.1959":"2020-12-08T15:41:35.460Z","1.0.0-pre.1960":"2020-12-08T23:51:49.443Z","1.0.0-pre.1979":"2020-12-09T23:49:33.392Z","1.0.0-pre.1989":"2020-12-10T15:15:09.957Z","1.0.0-pre.1994":"2020-12-11T08:39:31.507Z","1.0.0-pre.1998":"2020-12-11T12:19:58.640Z","1.0.0-pre.2002":"2020-12-11T15:48:50.104Z","1.0.0-pre.2023":"2020-12-12T19:23:26.053Z","1.0.0-pre.2024":"2020-12-13T01:05:31.678Z","1.0.0-pre.2025":"2020-12-13T02:15:07.565Z","1.0.0-pre.2026":"2020-12-13T02:53:35.822Z","1.0.0-pre.2027":"2020-12-13T11:38:57.869Z","1.0.0-pre.2028":"2020-12-13T12:48:06.566Z","1.0.0-pre.2031":"2020-12-14T14:37:49.584Z","1.0.0-pre.2033":"2020-12-15T14:51:45.501Z","1.0.0-pre.2034":"2020-12-15T16:03:36.115Z","1.0.0-pre.2036":"2020-12-16T02:07:16.361Z","1.0.0-pre.2073":"2020-12-25T13:46:26.269Z","1.0.0-pre.2075":"2021-01-05T19:29:31.646Z","1.0.0-pre.2076":"2021-01-05T19:55:45.501Z","1.0.0-pre.2077":"2021-01-05T20:04:48.310Z","1.0.0-pre.2078":"2021-01-05T21:52:59.658Z","1.0.0-pre.2079":"2021-01-05T22:35:00.215Z","1.0.0-pre.2082":"2021-01-07T01:07:50.766Z","1.0.0-pre.2084":"2021-01-10T21:26:20.794Z","1.0.0-pre.2085":"2021-01-10T22:49:13.766Z","1.0.0-pre.2086":"2021-01-12T22:07:58.665Z","1.0.0-pre.2087":"2021-01-13T10:37:06.060Z","1.0.0-pre.2091":"2021-01-15T13:00:14.940Z","1.0.0-pre.2093":"2021-01-19T22:42:27.895Z","1.0.0-pre.2094":"2021-01-20T14:46:01.109Z","1.0.0-pre.2096":"2021-01-21T14:17:09.892Z","1.0.0-pre.2098":"2021-01-26T09:46:34.170Z","1.0.0-pre.2104":"2021-02-02T14:31:49.415Z","1.0.0-pre.2107":"2021-02-06T21:34:07.032Z","1.0.0-pre.2108":"2021-02-07T01:29:09.900Z","1.0.0-pre.2112":"2021-02-10T21:31:20.572Z","1.0.0-pre.2117":"2021-02-11T13:45:30.373Z","1.0.0-pre.2137":"2021-02-23T14:47:53.872Z","1.0.0-pre.2196":"2021-03-09T09:09:08.395Z","1.0.0-pre.2217":"2021-03-15T10:11:34.128Z","0.13.0-pre.2244":"2021-03-18T17:28:07.036Z","0.13.0-pre.2253":"2021-03-20T00:43:08.631Z","0.13.0-pre.2254":"2021-03-20T13:51:04.132Z","0.13.0-pre.2284":"2021-03-23T16:37:50.061Z","0.13.0-pre.2290":"2021-03-23T20:41:21.864Z","0.13.0":"2021-03-24T10:20:56.597Z","1.0.0-pre.2296":"2021-03-24T13:46:56.887Z","0.13.1-pre.2307":"2021-03-25T17:20:44.493Z","0.13.1-pre.2312":"2021-03-26T14:38:54.851Z","0.13.1-pre.2323":"2021-03-30T14:17:03.973Z","0.13.1-pre.2326":"2021-03-31T11:00:59.015Z","0.13.1-pre.2329":"2021-04-11T23:47:16.137Z","0.13.1-pre.2330":"2021-04-12T13:03:14.136Z","0.13.1-pre.2336":"2021-04-13T15:17:57.797Z","0.13.1":"2021-04-13T16:26:40.423Z","0.13.2-pre.2341":"2021-04-13T22:42:44.301Z","0.13.2-pre.2352":"2021-04-15T15:39:20.468Z","0.13.2-pre.2364":"2021-04-16T20:25:45.038Z","0.13.2-pre.2383":"2021-04-20T13:21:24.676Z","0.13.2-pre.2387":"2021-04-22T22:56:32.231Z","0.13.2":"2021-04-27T16:18:19.730Z","0.13.3-pre.2417":"2021-05-04T09:36:08.592Z","0.13.3-pre.2419":"2021-05-04T11:02:58.265Z","0.13.3-pre.2433":"2021-05-05T21:44:42.750Z","0.13.3-pre.2435":"2021-05-06T20:51:49.550Z","0.13.3-pre.2437":"2021-05-09T01:02:48.553Z","0.13.3-pre.2442":"2021-05-09T20:32:06.800Z","0.13.3-pre.2460":"2021-05-19T13:36:35.691Z","0.13.3-pre.2477":"2021-05-25T14:46:52.174Z","0.13.3-pre.2480":"2021-05-28T07:31:16.106Z","0.13.3-pre.2585":"2021-06-15T15:34:30.529Z","0.13.3-pre.2783":"2021-06-27T15:10:10.638Z","0.13.3-pre.2928":"2021-07-20T00:03:24.398Z","0.13.3-pre.2931":"2021-07-21T09:28:21.869Z","0.13.3-pre.2936":"2021-07-26T14:07:30.366Z","0.13.3-pre.2937":"2021-07-28T12:37:31.494Z","0.13.3-pre.2940":"2021-07-28T21:20:57.276Z","0.13.3":"2021-07-28T22:07:14.089Z","0.14.0-pre.2948":"2021-07-31T23:46:35.254Z","0.14.0-unstable.2949":"2021-08-01T00:53:09.902Z","0.14.0-unstable.2952":"2021-08-02T14:07:39.995Z","0.13.4":"2021-08-02T21:10:54.484Z","0.14.0-pre.2954":"2021-08-02T23:10:51.012Z","0.14.0-pre.2955":"2021-08-03T14:49:37.259Z","0.14.0-pre.2958":"2021-08-04T00:33:36.393Z","0.14.0-pre.2964":"2021-08-06T12:46:41.911Z","0.14.0-pre.2970":"2021-08-09T00:20:29.730Z","0.14.0-pre.2975":"2021-08-17T21:37:13.182Z","0.13.5":"2021-08-17T21:37:53.253Z","0.13.6":"2021-08-27T10:35:37.207Z","0.14.0-pre.2983":"2021-08-27T13:39:26.515Z","0.14.0-pre.2998":"2021-08-30T20:46:49.304Z","0.14.0-pre.3018":"2021-09-01T09:21:01.719Z","0.13.7":"2021-09-01T11:49:34.971Z","0.14.0-unstable.3035":"2021-09-07T22:48:44.311Z","0.14.0-unstable.3037":"2021-09-08T16:46:22.016Z","0.14.0-unstable.3040":"2021-09-10T09:26:12.621Z","0.13.8":"2021-09-10T11:49:05.032Z","0.14.0-unstable.3058":"2021-09-13T12:44:40.821Z","0.14.0-unstable.3060":"2021-09-14T00:50:20.496Z","0.14.0-unstable.3062":"2021-09-15T07:53:56.463Z","0.14.0-unstable.3065":"2021-09-16T09:29:42.063Z","0.14.0-pre.3069":"2021-09-16T12:47:28.757Z","0.14.0-unstable.3068":"2021-09-16T12:47:37.505Z","0.14.0-unstable.3072":"2021-09-16T13:43:41.745Z","0.14.0-pre.3074":"2021-09-17T00:23:10.349Z","0.14.0-pre.3079":"2021-09-20T11:10:24.035Z","0.14.0-pre.3085":"2021-09-21T13:25:23.840Z","0.14.0-pre.3086":"2021-09-21T14:29:01.748Z","0.14.0-pre.3087":"2021-09-21T22:21:35.789Z","0.14.0-pre.3090":"2021-09-22T15:18:17.412Z","0.13.9":"2021-09-23T20:49:10.690Z","0.14.0-unstable.3096":"2021-10-05T00:15:12.085Z","0.14.0-pre.3097":"2021-10-05T20:43:26.972Z","0.14.0-pre.3098":"2021-10-06T00:38:23.802Z","0.14.0-pre.3099":"2021-10-07T11:31:33.339Z","0.14.0-unstable.3105":"2021-10-12T00:10:25.039Z","0.14.0-pre.3106":"2021-10-12T15:39:42.204Z","0.14.0-pre.3113":"2021-10-14T08:22:40.908Z","0.14.0-pre.3114":"2021-10-14T10:39:22.663Z","0.14.0-pre.3115":"2021-10-14T13:37:42.107Z","0.14.0-pre.3122":"2021-10-18T09:31:54.777Z","0.14.0-pre.3128":"2021-10-18T21:06:59.310Z","0.14.0-alpha.3152":"2021-10-21T13:12:20.890Z","0.14.0-alpha.3154":"2021-10-22T09:00:48.598Z","0.14.0-beta.3156":"2021-10-22T12:10:48.361Z","0.14.0-beta.3157":"2021-10-22T14:48:14.423Z","0.14.0-beta.3163":"2021-10-22T22:53:50.127Z","0.14.0-beta.3183":"2021-10-27T15:48:44.752Z","0.14.0-beta.3184":"2021-10-28T00:12:14.492Z","0.14.0-beta.3187":"2021-10-28T10:10:11.158Z","0.14.0-beta.3203":"2021-10-28T23:10:16.702Z","0.14.0-beta.3215":"2021-10-29T20:40:08.267Z","0.14.0-beta.3216":"2021-10-29T23:25:20.142Z","0.14.0-beta.3217":"2021-10-31T02:38:00.044Z","0.14.0-beta.3222":"2021-11-03T11:18:20.520Z","0.14.0-beta.3226":"2021-11-06T01:22:29.337Z","0.14.0-beta.3230":"2021-11-08T13:10:27.676Z","0.14.0":"2021-11-08T18:02:53.370Z","0.14.1-beta.3240":"2021-11-10T02:34:21.464Z","0.14.1-beta.3244":"2021-11-10T11:58:43.412Z","0.14.1-beta.3246":"2021-11-11T21:45:13.394Z","0.14.1-beta.3250":"2021-11-12T15:21:49.068Z","0.14.1-beta.3256":"2021-11-16T13:59:47.859Z","0.14.1-beta.3266":"2021-11-18T14:53:12.527Z","0.14.1":"2021-11-19T13:24:13.838Z","0.14.2-beta.3272":"2021-11-20T00:44:33.614Z","0.14.2":"2021-11-22T14:18:06.659Z","0.14.3-beta.3295":"2021-11-24T09:52:12.996Z","0.14.3-beta.3296":"2021-11-24T14:32:53.674Z","0.14.3-beta.3297":"2021-11-25T02:02:17.155Z","0.14.3-beta.3299":"2021-11-25T15:02:09.552Z","0.14.3-beta.3303":"2021-11-26T01:24:41.092Z","0.14.3":"2021-11-26T10:49:43.919Z","0.14.4-beta.3311":"2021-11-28T15:54:35.828Z","0.14.4-beta.3313":"2021-11-29T17:28:18.626Z","0.14.4":"2021-12-01T09:43:20.863Z","0.14.5-beta.3331":"2021-12-07T17:10:33.542Z","0.14.5-beta.3335":"2021-12-09T17:58:03.992Z","0.14.5-beta.3336":"2021-12-09T22:34:05.196Z","0.14.5-beta.3339":"2021-12-10T16:52:07.215Z","0.14.5-beta.3344":"2021-12-11T21:37:45.389Z","0.14.5-beta.3346":"2021-12-13T13:30:22.947Z","0.14.5-beta.3347":"2021-12-13T14:49:55.552Z","0.14.5":"2021-12-13T16:39:10.428Z","0.14.6-beta.3361":"2021-12-15T16:52:22.386Z","0.14.6-beta.3368":"2021-12-16T13:23:41.650Z","0.14.6-beta.3400":"2021-12-22T23:53:27.164Z","0.14.6-beta.3419":"2021-12-31T15:31:07.396Z","0.14.6-beta.3425":"2022-01-05T09:36:30.643Z","0.14.6":"2022-01-05T16:50:07.969Z","0.14.7-beta.3428":"2022-01-05T21:46:35.157Z","0.14.7-beta.3435":"2022-01-08T11:04:51.630Z","0.14.7-beta.3438":"2022-01-09T09:41:55.171Z","0.14.7-beta.3456":"2022-01-10T11:44:00.804Z","0.14.7-beta.3463":"2022-01-10T13:33:50.999Z","0.14.7-beta.3467":"2022-01-11T10:47:59.356Z","0.14.7-beta.3472":"2022-01-12T01:36:15.811Z","0.14.7":"2022-01-12T09:27:02.235Z","0.14.8-beta.3480":"2022-01-12T23:54:56.325Z","0.14.8-beta.3483":"2022-01-13T00:23:04.555Z","0.14.8-beta.3487":"2022-01-13T09:28:30.420Z","0.14.8-beta.3490":"2022-01-13T17:38:45.668Z","0.14.8-beta.3494":"2022-01-15T09:07:07.215Z","0.14.8-beta.3500":"2022-01-17T12:34:21.582Z","0.14.8-beta.3504":"2022-01-18T18:11:50.130Z","0.14.8-beta.3509":"2022-01-19T08:53:16.245Z","0.14.8-beta.3510":"2022-01-20T00:47:59.680Z","0.14.8-beta.3511":"2022-01-20T02:02:01.629Z","0.14.8-beta.3513":"2022-01-20T10:26:34.809Z","0.14.8-beta.3515":"2022-01-20T12:13:12.062Z","0.14.8":"2022-01-20T13:46:34.346Z","0.14.9-beta.3522":"2022-01-21T00:59:54.461Z","0.14.9-beta.3526":"2022-01-21T11:00:58.492Z","0.14.9":"2022-01-21T11:14:55.862Z","0.15.0-alpha.3537":"2022-01-21T21:44:48.441Z","0.15.0-alpha.3540":"2022-01-22T15:12:54.979Z","0.15.0-alpha.3548":"2022-01-25T19:32:40.617Z","0.15.0-alpha.3549":"2022-01-25T19:52:16.423Z","0.15.0-alpha.3555":"2022-01-27T01:48:25.470Z","0.15.0-alpha.3564":"2022-01-28T11:26:35.667Z","0.15.0-alpha.3589":"2022-02-02T18:03:37.712Z","0.15.0-alpha.3592":"2022-02-03T01:17:02.492Z","0.14.10-beta.3615":"2022-02-04T13:37:24.842Z","0.14.10-beta.3616":"2022-02-04T13:41:54.255Z","0.14.10-beta.3621":"2022-02-04T18:24:20.802Z","0.14.10":"2022-02-04T21:46:50.619Z","0.15.0-alpha.3640":"2022-02-09T23:25:02.351Z","0.14.10-beta.3659":"2022-02-13T10:46:09.530Z","0.14.10-beta.3661":"2022-02-13T11:00:22.271Z","0.15.0-alpha.3662":"2022-02-13T11:24:45.824Z","0.14.11-beta.3674":"2022-02-17T11:24:28.797Z","0.14.11-beta.3680":"2022-02-17T13:42:46.944Z","0.14.11-beta.3683":"2022-02-17T15:10:52.404Z","0.14.11-beta.3686":"2022-02-17T15:41:28.605Z","0.14.11":"2022-02-17T16:37:37.529Z","0.14.12-beta.3701":"2022-02-20T17:01:22.710Z","0.14.12-beta.3703":"2022-02-20T19:38:16.825Z","0.14.12-beta.3704":"2022-02-20T23:17:38.986Z","0.14.12":"2022-02-21T10:12:37.565Z","0.15.0-alpha.3711":"2022-02-21T21:31:13.223Z","0.15.0-alpha.3719":"2022-02-23T09:25:14.298Z","0.15.0-alpha.3724":"2022-02-23T16:01:30.439Z","0.14.13-beta.3733":"2022-02-26T15:37:03.720Z","0.14.13-beta.3734":"2022-02-26T23:10:06.615Z","0.14.13":"2022-02-27T10:16:03.512Z","0.15.0-alpha.3740":"2022-02-27T12:17:25.569Z","0.14.14-beta.3748":"2022-03-01T10:53:46.635Z","0.14.14-beta.3753":"2022-03-01T13:57:36.044Z","0.14.14-beta.3765":"2022-03-02T17:57:59.788Z","0.14.14-beta.3767":"2022-03-02T21:12:32.102Z","0.14.14":"2022-03-03T01:26:50.266Z","0.15.0-alpha.3784":"2022-03-03T22:12:29.443Z","0.14.15-beta.3790":"2022-03-04T13:50:54.951Z","0.14.15-beta.3791":"2022-03-04T16:06:17.751Z","0.14.15-beta.3795":"2022-03-04T18:16:44.303Z","0.14.15":"2022-03-05T09:08:51.887Z","0.15.0-alpha.3804":"2022-03-05T14:02:28.655Z","0.15.0-alpha.3809":"2022-03-06T09:55:41.223Z","0.15.0-alpha.3816":"2022-03-08T09:11:06.228Z","0.14.16-beta.3830":"2022-03-09T16:32:29.765Z","0.14.16-beta.3834":"2022-03-10T10:11:40.968Z","0.14.16-beta.3841":"2022-03-10T13:06:15.238Z","0.14.16-beta.3852":"2022-03-10T13:20:04.661Z","0.14.16-beta.3861":"2022-03-10T13:24:11.144Z","0.14.16-beta.3846":"2022-03-10T13:32:16.491Z","0.14.16-beta.3856":"2022-03-10T13:37:23.360Z","0.14.16-beta.3843":"2022-03-10T13:41:51.467Z","0.14.16-beta.3850":"2022-03-10T13:51:38.812Z","0.14.16-beta.3860":"2022-03-10T13:57:05.627Z","0.14.16-beta.3863":"2022-03-10T14:01:46.018Z","0.14.16-beta.3855":"2022-03-10T14:02:54.872Z","0.14.16":"2022-03-10T15:26:55.620Z","0.14.17-beta.3882":"2022-03-11T15:51:27.101Z","0.14.17":"2022-03-13T16:18:46.634Z","0.15.0-alpha.3905":"2022-03-14T01:38:39.073Z","0.14.18-beta.3923":"2022-03-15T00:51:25.947Z","0.14.18":"2022-03-15T08:51:15.759Z","0.14.19-beta.3927":"2022-03-15T17:55:02.569Z","0.15.0-alpha.3933":"2022-03-16T10:19:03.873Z","0.14.19-beta.3953":"2022-03-18T02:56:10.802Z","0.14.19-beta.3964":"2022-03-18T18:17:42.876Z","0.14.19-beta.3968":"2022-03-19T14:52:53.454Z","0.14.19-beta.3970":"2022-03-20T03:12:16.851Z","0.14.19":"2022-03-20T09:55:23.963Z","0.15.0-alpha.3975":"2022-03-21T07:29:33.831Z","0.14.20-beta.3989":"2022-03-24T03:55:14.838Z","0.15.0-alpha.4005":"2022-03-25T19:22:57.729Z","0.14.20-beta.4013":"2022-03-30T21:10:39.585Z","0.14.20-beta.4017":"2022-03-31T07:29:24.600Z","0.14.20":"2022-04-01T08:27:25.870Z","0.15.0-alpha.4027":"2022-04-02T15:20:55.981Z","0.15.0-alpha.4028":"2022-04-03T10:34:03.949Z","0.15.0-alpha.4029":"2022-04-04T00:49:43.636Z","0.15.0-alpha.4034":"2022-04-04T09:01:29.954Z","0.15.0-alpha.4036":"2022-04-05T15:04:33.155Z","0.15.0-alpha.4041":"2022-04-07T13:17:22.247Z","0.14.20-beta.4064":"2022-04-10T11:15:53.691Z","0.14.20-beta.4067":"2022-04-10T14:51:12.436Z","0.14.21-beta.4074":"2022-04-11T10:35:50.588Z","0.14.21-beta.4078":"2022-04-11T17:06:47.438Z","0.14.21":"2022-04-12T16:56:26.273Z","0.15.0-alpha.4098":"2022-04-13T15:21:35.993Z","0.14.22-beta.4103":"2022-04-18T21:39:34.132Z","0.14.22-beta.4113":"2022-04-25T13:01:15.756Z","0.14.22":"2022-04-25T16:13:13.127Z","0.15.0-alpha.4122":"2022-04-26T13:35:44.455Z","0.14.23-beta.4124":"2022-04-27T15:11:42.297Z","0.14.23-beta.4129":"2022-04-30T08:36:13.012Z","0.14.23-beta.4131":"2022-04-30T14:38:29.173Z","0.14.23":"2022-05-01T12:51:50.974Z","0.14.24-beta.4144":"2022-05-04T12:57:30.688Z","0.14.24-beta.4150":"2022-05-04T22:50:17.529Z","0.14.24-beta.4157":"2022-05-05T13:53:47.279Z","0.14.24-beta.4161":"2022-05-06T14:35:53.513Z","0.14.24-beta.4163":"2022-05-07T00:01:03.119Z","0.14.24-beta.4168":"2022-05-09T13:23:33.805Z","0.14.24-beta.4171":"2022-05-09T16:53:24.587Z","0.14.24-beta.4191":"2022-05-12T15:28:40.391Z","0.14.24-beta.4195":"2022-05-13T10:21:15.937Z","0.14.24":"2022-05-13T14:28:56.101Z","0.14.25-beta.4229":"2022-05-19T22:45:24.539Z","0.15.0-alpha.4231":"2022-05-19T22:53:21.652Z","0.14.25-beta.4238":"2022-05-20T14:13:07.988Z","0.14.25-beta.4245":"2022-05-21T23:03:58.148Z","0.14.25":"2022-05-22T23:35:10.118Z","0.15.0-alpha.4257":"2022-05-24T14:56:08.471Z","0.14.25-beta.4266":"2022-06-02T07:50:11.153Z","0.14.26-beta.4273":"2022-06-04T07:13:38.168Z","0.14.26-beta.4274":"2022-06-04T08:01:01.145Z","0.14.26":"2022-06-05T14:20:58.099Z","0.14.27-beta.4280":"2022-06-05T23:42:34.146Z","0.15.0-alpha.4284":"2022-06-06T09:52:30.884Z","0.14.27-beta.4285":"2022-06-06T12:07:06.443Z","0.14.27-beta.4290":"2022-06-06T22:21:01.969Z","0.14.27":"2022-06-07T00:19:38.922Z","0.15.0-alpha.4311":"2022-06-08T13:41:35.422Z","0.15.0-alpha.4314":"2022-06-09T15:00:32.669Z","0.15.0-alpha.4332":"2022-06-14T10:24:19.290Z","0.15.0-alpha.4345":"2022-06-20T23:23:15.929Z","0.15.0-alpha.4355":"2022-06-24T11:41:29.695Z","0.14.28-beta.4360":"2022-06-27T12:33:12.706Z","0.14.28-beta.4363":"2022-06-28T09:38:44.252Z","0.14.28-beta.4379":"2022-07-01T07:08:46.279Z","0.14.28":"2022-07-01T10:35:03.939Z","0.14.29":"2022-07-05T09:47:25.110Z","0.15.0-alpha.4396":"2022-07-05T23:05:37.440Z","0.15.0-alpha.4399":"2022-07-06T13:49:55.542Z","0.15.0-alpha.4409":"2022-07-07T17:10:47.194Z","0.15.0-beta.4411":"2022-07-09T12:24:40.284Z","0.15.0-beta.4465":"2022-07-21T08:17:02.172Z","0.15.0-beta.4466":"2022-07-21T17:20:55.816Z","0.15.0-beta.4472":"2022-07-25T23:17:57.190Z","0.15.0-beta.4512":"2022-07-29T23:10:52.109Z","0.15.0-beta.4544":"2022-08-05T09:16:08.501Z","0.15.0-beta.4549":"2022-08-06T15:56:23.063Z","0.15.0-beta.4560":"2022-08-08T10:07:13.786Z","0.15.0-beta.4574":"2022-08-11T13:58:02.418Z","0.15.0-beta.4579":"2022-08-16T21:30:45.110Z","0.15.0-beta.4607":"2022-08-25T13:13:45.980Z","0.14.30":"2022-08-26T08:14:19.322Z","0.15.0-beta.4630":"2022-08-29T23:58:03.475Z","0.15.0-beta.4633":"2022-08-30T19:26:29.025Z","0.14.31":"2022-09-07T23:57:02.551Z","0.15.0-beta.4670":"2022-09-20T22:34:45.377Z","0.15.0-beta.4672":"2022-09-21T22:43:32.004Z","0.14.32":"2022-09-21T23:11:14.436Z","0.15.0-beta.4696":"2022-09-29T15:33:47.153Z","0.15.0-beta.4699":"2022-10-01T23:49:56.614Z","0.15.0-beta.4708":"2022-10-02T21:48:14.721Z","0.15.0-beta.4715":"2022-10-03T19:00:56.229Z","0.15.0-beta.4725":"2022-10-04T18:58:06.712Z","0.15.0-beta.4739":"2022-10-09T09:53:54.589Z","0.15.0-beta.4751":"2022-10-15T14:15:46.913Z","0.15.0-beta.4756":"2022-10-19T23:51:22.733Z","0.15.0-beta.4790":"2022-10-25T15:07:05.221Z","0.15.0-beta.4791":"2022-10-25T20:43:10.007Z","0.15.0-beta.4798":"2022-11-01T21:18:25.708Z","0.15.0-beta.4801":"2022-11-03T14:03:33.634Z","0.15.0-beta.4803":"2022-11-05T02:15:26.282Z","0.15.0-beta.4808":"2022-11-09T11:51:45.941Z","0.15.0-beta.4812":"2022-11-13T01:16:07.066Z","0.15.0-beta.4813":"2022-11-14T00:49:53.846Z","0.15.0-beta.4815":"2022-11-14T10:57:17.289Z","0.15.0-beta.4816":"2022-11-14T20:51:08.246Z","0.15.0-beta.4820":"2022-11-15T22:37:28.739Z","0.15.0-beta.4828":"2022-11-16T16:46:02.206Z","0.15.0-beta.4830":"2022-11-16T17:56:47.733Z","0.15.0":"2022-11-17T00:45:45.889Z","0.15.1-beta.4903":"2022-11-23T23:36:29.503Z","0.15.1-beta.4906":"2022-11-24T14:28:01.933Z","0.15.1-beta.4908":"2022-11-24T23:45:53.660Z","0.15.1-beta.4910":"2022-11-24T23:58:13.556Z","0.15.1":"2022-11-25T11:44:24.036Z","0.15.2-beta.4915":"2022-11-27T08:03:17.527Z","0.15.2-beta.4921":"2022-11-28T00:42:59.495Z","0.15.2-beta.4923":"2022-11-28T16:26:39.349Z","0.15.2-beta.4932":"2022-11-30T01:56:53.583Z","0.15.2-beta.4938":"2022-12-02T12:44:10.612Z","0.15.2-beta.4941":"2022-12-03T14:46:45.292Z","0.15.2-beta.4943":"2022-12-04T23:25:29.166Z","0.15.2":"2022-12-05T01:12:30.793Z","0.15.3-beta.4955":"2022-12-09T17:22:45.681Z","0.15.3-beta.4970":"2022-12-13T11:18:40.441Z","0.15.3-beta.4975":"2022-12-13T17:13:25.962Z","0.15.3-beta.4989":"2022-12-16T00:39:05.043Z","0.15.3":"2022-12-16T16:26:08.037Z","0.15.4-beta.5008":"2022-12-19T16:09:16.180Z","0.15.4-beta.5013":"2022-12-21T12:08:51.722Z","0.15.4-beta.5015":"2022-12-21T14:36:31.684Z","0.15.4":"2022-12-21T15:55:58.003Z","0.15.5-beta.5022":"2022-12-22T20:18:36.128Z","0.15.5-beta.5054":"2023-01-16T10:08:34.876Z","0.15.5-beta.5073":"2023-01-20T00:09:13.323Z","0.15.5-beta.5087":"2023-01-23T08:13:31.236Z","0.15.5":"2023-01-23T09:08:50.406Z","0.15.6-beta.5100":"2023-01-27T00:55:34.395Z","0.15.6-beta.5103":"2023-01-27T09:08:41.952Z","0.15.6-beta.5105":"2023-01-27T13:09:09.648Z","0.15.6-beta.5106":"2023-01-27T20:03:17.006Z","0.15.6-beta.5109":"2023-01-28T20:47:59.135Z","0.15.6":"2023-01-30T14:21:18.458Z","0.15.7-beta.5126":"2023-02-01T09:36:18.121Z","0.15.7-beta.5134":"2023-02-02T09:30:06.545Z","0.15.7-beta.5135":"2023-02-02T09:32:23.845Z","0.15.7-beta.5146":"2023-02-04T10:01:42.544Z","0.15.7-beta.5147":"2023-02-05T20:04:57.993Z","0.15.7-beta.5155":"2023-02-09T13:39:18.171Z","0.15.7":"2023-02-10T09:10:24.231Z","0.15.8-beta.5168":"2023-02-10T20:22:09.312Z","0.15.8-beta.5218":"2023-03-01T17:37:47.351Z","0.15.8-beta.5219":"2023-03-01T23:50:51.703Z","0.15.8-beta.5224":"2023-03-02T13:35:14.994Z","0.15.8-beta.5229":"2023-03-02T18:04:20.722Z","0.15.8-beta.5238":"2023-03-03T08:54:09.025Z","0.15.8-beta.5261":"2023-03-06T16:07:48.303Z","0.15.8-beta.5269":"2023-03-07T12:44:53.376Z","0.15.8-beta.5276":"2023-03-07T22:30:44.495Z","0.15.8-beta.5281":"2023-03-08T08:20:06.746Z","0.15.8-beta.5283":"2023-03-08T08:20:12.775Z","0.15.8":"2023-03-08T09:27:46.064Z","0.15.8-beta.5316":"2023-03-15T08:26:21.180Z","0.15.9-beta.5384":"2023-03-29T09:15:13.276Z","0.15.9-beta.5387":"2023-03-30T07:22:59.393Z","0.15.9-beta.5415":"2023-04-07T22:36:19.514Z","0.15.9-beta.5417":"2023-04-08T12:15:25.816Z","0.15.9-beta.5420":"2023-04-10T09:19:18.496Z","0.15.9-beta.5423":"2023-04-10T11:13:35.285Z","0.15.9-beta.5435":"2023-04-11T09:28:32.073Z","0.15.9-beta.5437":"2023-04-11T10:59:03.761Z","0.15.9":"2023-04-11T18:27:49.266Z","0.15.10-beta.5447":"2023-04-13T20:16:17.390Z","0.15.10-beta.5457":"2023-04-17T08:03:36.556Z","0.15.10-beta.5462":"2023-04-18T08:56:37.106Z","0.15.10-beta.5463":"2023-04-18T10:39:35.088Z","0.15.10-beta.5490":"2023-04-28T10:29:14.671Z","0.15.10-beta.5491":"2023-04-28T15:21:40.553Z","0.15.10-beta.5496":"2023-05-04T13:56:16.085Z","0.15.10":"2023-05-08T10:17:48.689Z","0.15.11-beta.5506":"2023-05-11T13:27:04.546Z","0.15.11":"2023-05-15T12:59:22.108Z","0.15.12-beta.5528":"2023-05-17T00:05:51.502Z","0.15.12-beta.5531":"2023-05-17T16:54:54.919Z","0.15.12-beta.5535":"2023-05-19T07:24:27.190Z","0.15.12-beta.5538":"2023-05-19T12:10:14.370Z","0.15.12-beta.5541":"2023-05-19T16:17:44.682Z","0.15.12":"2023-05-19T23:23:23.487Z","0.15.13-beta.5556":"2023-05-22T14:36:05.454Z","0.15.13-beta.5560":"2023-05-24T12:34:26.591Z","0.15.13-beta.5575":"2023-05-26T16:07:37.640Z","0.15.13-beta.5583":"2023-05-29T12:56:21.946Z","0.15.13-beta.5591":"2023-05-31T09:47:12.974Z","0.15.13":"2023-05-31T09:47:18.781Z"},"bugs":{"url":"https://github.com/smapiot/piral/issues"},"author":{"name":"smapiot"},"license":"MIT","homepage":"https://piral.io","keywords":["piral","pilet-api","smapiot","portal","modules","api","plugin","plugin-content","pwa","progressive","app"],"repository":{"url":"git+https://github.com/smapiot/piral.git","type":"git"},"description":"Plugin for creating the Piral instance as a PWA shell.","maintainers":[{"email":"mail@florian-rappl.de","name":"florianrappl"},{"email":"mail@manuelroemer.com","name":"manuel.roemer"},{"email":"lothar.schoettner@smapiot.com","name":"lschoett"}],"readme":"[![Piral Logo](https://github.com/smapiot/piral/raw/main/docs/assets/logo.png)](https://piral.io)\n\n# [Piral PWA](https://piral.io) &middot; [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-pwa.svg?style=flat)](https://www.npmjs.com/package/piral-pwa) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)\n\nThis is a plugin that has a peer dependency to `piral-core` and **requires** `parcel-bundler` to work.\n\n::: warning: Only use with Parcel\n\nMost likely this plugin will only work with `piral-cli-parcel` as it depends on a codegen that assumes Parcel is in charge of bundling. If you need something similar for Webpack have a look [here](https://webpack.js.org/guides/progressive-web-application/), or even better [here](https://github.com/NekR/offline-plugin).\n\n:::\n\nWhat `piral-pwa` brings to the table is a simple way to expose your application as a PWA with the capability to use offline storage for pilets, too.\n\nBy default, these API extensions are not integrated in `piral`, so you'd need to add them to your Piral instance.\n\n## Why and When\n\nA progressive web app (PWA) is the next step in the evolution of web applications. Quite naturally, a microfrontend solution should also be capable of being turned into a PWA. To use some of the PWA capabilities from pilets without further checks the pilet API has been extended with some PWA specific functions. The most important part of this plugin, however, is to fully integrate the `ServiceWorker` into the app shell.\n\nAlternatives: Set up a `ServiceWorker` yourself or use a known library (e.g., WorkBox) or bundler plugin to do this for you.\n\n## Documentation\n\nThe following functions are brought to the Pilet API.\n\n### `showAppNotification()`\n\nAllows pilets to present a \"native\" notification. The exact looks of this are platform dependent, e.g., on Chrome for Windows 10 an item as added to the notification bar. On Chrome for MacOS X a quick notification appears.\n\n## Usage\n\n::: summary: For pilet authors\n\nYou can use the `showAppNotification` function from the Pilet API to show a native notification in the host browser or operating system from the Piral instance.\n\nExample use:\n\n```ts\nimport { PiletApi } from '<name-of-piral-instance>';\n\nexport function setup(piral: PiletApi) {\n  piral.showAppNotification('Pilet started!', {\n    body: 'The sample pilet was successfully set up...',\n  });\n}\n```\n\n:::\n\n::: summary: For Piral instance developers\n\nThe provided library only brings API extensions for pilets to a Piral instance.\n\nIn order to get your Progressive Web App correctly running you'll also need a `manifest.webmanifest` file. You can locate it next to your `index.html` file.\n\nThe content of `manifest.webmanifest` can be as simple as:\n\n```json\n{\n  \"name\": \"Example App\",\n  \"short_name\": \"ExApp\",\n  \"theme_color\": \"#2196f3\",\n  \"background_color\": \"#2196f3\",\n  \"display\": \"standalone\",\n  \"scope\": \"/\",\n  \"start_url\": \"/\",\n  \"icons\": [\n    {\n      \"src\": \"images/icon-144x144.png\",\n      \"sizes\": \"144x144\",\n      \"type\": \"image/png\"\n    }\n  ]\n}\n```\n\n**Note**: You'll need at least a 144x144 pixels sized icon. This is not a requirement of `piral-pwa`, but rather of how PWAs work.\n\nThe `manifest.webmanifest` needs to be referenced by your `index.html` file. If both files are adjacent this can be done with the following code:\n\n```html\n<link rel=\"manifest\" href=\"./manifest.webmanifest\">\n```\n\nFor the setup of the library itself you'll need to import `createPwaApi` from the `piral-pwa` package.\n\n```ts\nimport { createPwaApi } from 'piral-pwa';\n```\n\nThe integration looks like:\n\n```ts\nconst instance = createInstance({\n  // important part\n  plugins: [createPwaApi()],\n  // ...\n});\n```\n\n### Customizing the Service Worker\n\nBy default, a service worker is generated for you. This behavior can be overridden if you place a file called `sw.js` in your `src` folder.\n\nThe server worker file is automatically enhanced with the following template variables:\n\n- `__PARAMS__`, defines general parameters such as the `responseStrategy` or the URLs from `externals` to consider\n- `__HELPERS__`, defines the `cacheMaps` for setting up the caching strategy and the `navigationPreload` property\n- `__DEBUG__`, which is either `true` or `false` depending on the runtime mode\n\nYou don't need to use them, but they can be quite helpful. For instance, on `__PARAMS__`, you'll find the fields for `name` and `version` of your app.\n\n**Remark**: How the parameters and helpers can be influenced (i.e., configured) is currently work in progress and should be figured out until v1.\n\n### Configuration of the Provided Options\n\nThe parameters for the generated service worker can be configured, too. All in all this follows the options known from Webpack's [offline-plugin](https://github.com/NekR/offline-plugin), see [options](https://github.com/NekR/offline-plugin/blob/master/docs/options.md) for explanations.\n\nIn a nutshell, in order to use the options you'll need a file called `.pwarc` in the root directory of your application (i.e., next to your `package.json`).\n\nThe `.pwarc` may look as follows:\n\n```js\n{\n  updateStrategy: 'all',\n  responseStrategy: 'network-first',\n  externals: ['https://api.myhost.com/logo.png', '/static/image.jpg'],\n  excludes: ['**/.*', '**/*.map', '**/*.gz'],\n  cacheMaps: [],\n  navigationPreload: false,\n  caches: 'all',\n}\n```\n\nMore details on the configuration will follow. Further options will be integrated soon, too.\n\n:::\n\n## License\n\nPiral is released using the MIT license. For more information see the [license file](./LICENSE).\n","readmeFilename":"README.md"}