{"_id":"@polyfea/service-worker","_rev":"8-2fa6465b2e29e6a65a42ab02b796d344","name":"@polyfea/service-worker","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.2":{"name":"@polyfea/service-worker","version":"0.0.2","keywords":["polyfea","service-worker","microfrontend"],"author":{"name":"Polyfea Team"},"license":"Apache-2.0","_id":"@polyfea/service-worker@0.0.2","maintainers":[{"name":"michalsevcik","email":"michal.sevcik@protonmail.com"},{"name":"milung","email":"milan.kvetko@gmail.com"}],"homepage":"https://github.com/polyfea/service-worker#readme","bugs":{"url":"https://github.com/polyfea/service-worker/issues"},"dist":{"shasum":"7f105ed9f6bd1546201e809e98f3244cc769f39c","tarball":"https://registry.npmjs.org/@polyfea/service-worker/-/service-worker-0.0.2.tgz","fileCount":17,"integrity":"sha512-SnjvV7dj0sf/dCKyUxyGJnSTjo6KCSV/UfrgB2Ez6HPacB8KnXFhsxOMYzkz1z2hfe46epmacY16645svkM2EQ==","signatures":[{"sig":"MEQCIC18ZPosV9n033plyDgFjfW2/F0MT+1exJ7JDmCfRtv8AiAOHIOK+sfx4Z9yjupY8yBzjmQ47Qok6nZiKOLLZHM6sw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":788494},"main":"dist/sw.mjs","types":"./dist/types/index.d.ts","module":"dist/sw.mjs","gitHead":"069de46c2d7b29543e8cbaa7b57f8c8ca7f5f48b","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"run-s build.sw build.register","start":"run-p start.sw start.register","typedoc":"npx typedoc --plugin typedoc-plugin-markdown --gitRevision main src/index.ts","build.sw":"vite build --mode production --config vite.config.sw.ts","start.sw":"vite build --watch --mode development --config vite.config.sw.ts","build.register":"vite build --mode production --config vite.config.register.ts","start.register":"vite --port 3000 --mode development --config vite.config.register.ts"},"_npmUser":{"name":"milung","email":"milan.kvetko@gmail.com"},"repository":{"url":"git+https://github.com/polyfea/service-worker.git","type":"git"},"_npmVersion":"10.5.0","description":"Service worker for Polyfea","directories":{},"_nodeVersion":"21.7.3","dependencies":{"pino":"^9.1.0","workbox-window":"^7.1.0","workbox-precaching":"^7.1.0","workbox-background-sync":"^7.1.0"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","vite":"^5.2.11","eslint":"^9.3.0","typedoc":"^0.25.13","typescript":"^5.4.5","http-server":"^14.1.1","npm-run-all":"^4.1.5","workbox-cli":"^7.1.0","vite-plugin-dts":"^3.9.1","typedoc-plugin-markdown":"^4.0.2","vite-plugin-environment":"^1.1.3"},"_npmOperationalInternal":{"tmp":"tmp/service-worker_0.0.2_1716571795158_0.8113515780287714","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"@polyfea/service-worker","version":"0.1.0","keywords":["polyfea","service-worker","microfrontend"],"author":{"name":"Polyfea Team"},"license":"Apache-2.0","_id":"@polyfea/service-worker@0.1.0","maintainers":[{"name":"michalsevcik","email":"michal.sevcik@protonmail.com"},{"name":"milung","email":"milan.kvetko@gmail.com"}],"homepage":"https://github.com/polyfea/service-worker#readme","bugs":{"url":"https://github.com/polyfea/service-worker/issues"},"dist":{"shasum":"c2b66cbce2cf8541e22222d59ffd9b4edfe4f96a","tarball":"https://registry.npmjs.org/@polyfea/service-worker/-/service-worker-0.1.0.tgz","fileCount":18,"integrity":"sha512-gooyfJa8opj1n66l7w9Zk5YrziTndWnzjmsvHcPg4Bd/Hck0PHnt9NeJUJoYzj6gZRYNr9POuYUbDWqIkehY/g==","signatures":[{"sig":"MEUCIH6Bzi8vk8mZHgKeGsOq0P3F6mt2hoJC2JNGFN06ApNeAiEA8q9H4xR7uk1bqiwVgfn54koE52ox8jR3GhXkJxM5dHo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":800090},"main":"dist/sw.mjs","types":"./dist/types/index.d.ts","module":"dist/sw.mjs","gitHead":"1a792d54c07ce4a248e543e0464a493f31d27bc3","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"run-s build.sw build.register","start":"run-p start.sw start.register","typedoc":"npx typedoc --plugin typedoc-plugin-markdown --gitRevision main src/index.ts","build.sw":"vite build --mode production --config vite.config.sw.mts","start.sw":"vite build --watch --mode development --config vite.config.sw.mts","build.register":"vite build --mode production --config vite.config.register.mts","start.register":"vite --port 3000 --mode development --config vite.config.register.mts"},"_npmUser":{"name":"milung","email":"milan.kvetko@gmail.com"},"repository":{"url":"git+https://github.com/polyfea/service-worker.git","type":"git"},"_npmVersion":"10.5.0","description":"Service worker for Polyfea","directories":{},"_nodeVersion":"21.7.3","dependencies":{"pino":"^9.1.0","workbox-window":"^7.1.0","workbox-precaching":"^7.1.0","workbox-background-sync":"^7.1.0"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","vite":"^5.2.11","eslint":"^9.3.0","typedoc":"^0.25.13","typescript":"^5.4.5","http-server":"^14.1.1","npm-run-all":"^4.1.5","workbox-cli":"^7.1.0","vite-plugin-dts":"^3.9.1","typedoc-plugin-markdown":"^4.0.2","vite-plugin-environment":"^1.1.3"},"_npmOperationalInternal":{"tmp":"tmp/service-worker_0.1.0_1716896541782_0.5243942854283066","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@polyfea/service-worker","version":"0.2.0","keywords":["polyfea","service-worker","microfrontend"],"author":{"name":"Polyfea Team"},"license":"Apache-2.0","_id":"@polyfea/service-worker@0.2.0","maintainers":[{"name":"milung","email":"milan.kvetko@gmail.com"},{"name":"michalsevcik","email":"michal.sevcik@protonmail.com"}],"homepage":"https://github.com/polyfea/service-worker#readme","bugs":{"url":"https://github.com/polyfea/service-worker/issues"},"dist":{"shasum":"8246a8ee57031db9402abb6c3cec5d869d3c3ba5","tarball":"https://registry.npmjs.org/@polyfea/service-worker/-/service-worker-0.2.0.tgz","fileCount":18,"integrity":"sha512-UvejHnWhCx/MzEtqhafnxOfG6INzJZPx+cWflLLpx+9+ahjo0S0FSWptGslvwRfbxBulCovvxS1dMCgFLKm09w==","signatures":[{"sig":"MEUCIGuZ7+f8PWWARwrYN5U/UV8gDgyHQL0fvNoS56F72x8DAiEAtrsKlqdACicnV/m4pWapn/sGGps1WFp+CRFpF+WH1fI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@polyfea%2fservice-worker@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":731865},"main":"dist/sw.mjs","types":"./dist/types/index.d.ts","module":"dist/sw.mjs","gitHead":"94de4e043869587d73e4a606181dd183e002d5b3","scripts":{"test":"vitest run","build":"run-s build.sw build.register","start":"run-p start.sw start.register","typedoc":"npx typedoc --plugin typedoc-plugin-markdown --gitRevision main src/index.ts","build.sw":"vite build --mode production --config vite.config.sw.mts","coverage":"vitest run --coverage --coverage.thresholds.statements=100","start.sw":"vite build --watch --mode development --config vite.config.sw.mts","test:watch":"vitest","build.register":"vite build --mode production --config vite.config.register.mts","start.register":"vite --port 3000 --mode development --config vite.config.register.mts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7322e016-4a1d-4774-a7c5-8467d49488eb"}},"repository":{"url":"git+https://github.com/polyfea/service-worker.git","type":"git"},"_npmVersion":"11.12.1","description":"Service worker for Polyfea","directories":{},"_nodeVersion":"25.9.0","dependencies":{"pino":"^10.3.1","workbox-window":"^7.4.0","workbox-precaching":"^7.4.0","workbox-background-sync":"^7.4.0"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","vite":"^8.0.8","eslint":"^10.2.0","vitest":"^4.1.4","typedoc":"^0.28.18","happy-dom":"^20.8.9","typescript":"^6.0.2","http-server":"^14.1.1","npm-run-all":"^4.1.5","workbox-cli":"^7.4.0","@emnapi/core":"^1.9.2","fake-indexeddb":"^6.2.5","@emnapi/runtime":"^1.9.2","vite-plugin-dts":"^4.5.4","@vitest/coverage-v8":"^4.1.4","typedoc-plugin-markdown":"^4.11.0","vite-plugin-environment":"^1.1.3"},"_npmOperationalInternal":{"tmp":"tmp/service-worker_0.2.0_1776449330263_0.6325264901016008","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@polyfea/service-worker","version":"0.3.0","description":"Service worker for Polyfea","main":"dist/sw.mjs","module":"dist/sw.mjs","types":"./dist/types/index.d.ts","scripts":{"build.sw":"vite build --mode production --config vite.config.sw.mts","build.register":"vite build --mode production --config vite.config.register.mts","build":"run-s build.sw build.register","start.sw":"vite build --watch --mode development --config vite.config.sw.mts","start.register":"vite --port 3000 --mode development --config vite.config.register.mts","start":"run-p start.sw start.register","test":"vitest run","test:watch":"vitest","coverage":"vitest run --coverage --coverage.thresholds.statements=100","typedoc":"npx typedoc --plugin typedoc-plugin-markdown --gitRevision main src/index.ts"},"repository":{"type":"git","url":"git+https://github.com/polyfea/service-worker.git"},"keywords":["polyfea","service-worker","microfrontend"],"author":{"name":"Polyfea Team"},"license":"Apache-2.0","bugs":{"url":"https://github.com/polyfea/service-worker/issues"},"homepage":"https://github.com/polyfea/service-worker#readme","devDependencies":{"@emnapi/core":"^1.10.0","@emnapi/runtime":"^1.10.0","@vitest/coverage-v8":"^4.1.5","eslint":"^10.2.1","fake-indexeddb":"^6.2.5","happy-dom":"^20.9.0","http-server":"^14.1.1","npm-run-all":"^4.1.5","tsc":"^2.0.4","typedoc":"^0.28.19","typedoc-plugin-markdown":"^4.11.0","typescript":"^6.0.3","vite":"^8.0.9","vite-plugin-dts":"^4.5.4","vite-plugin-environment":"^1.1.3","vitest":"^4.1.5","workbox-cli":"^7.0.0"},"dependencies":{"import":"^0.0.6","pino":"^10.3.1","workbox-background-sync":"^7.4.0","workbox-broadcast-update":"^7.4.0","workbox-precaching":"^7.4.0","workbox-window":"^7.4.0"},"gitHead":"3d24da90d1c942f760cd68b7439c7f8aa104b32a","_id":"@polyfea/service-worker@0.3.0","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-+dxnC+VkULNj8rpTmaqyt2uq0j2iqupOnxVOmznR51RyP53xc2kLKCdOkXV1e5KaSIvzEoRLVx8PAjBAbmuR4w==","shasum":"5da7aa8241720dacd2fccb1e5f147c41236a9e53","tarball":"https://registry.npmjs.org/@polyfea/service-worker/-/service-worker-0.3.0.tgz","fileCount":18,"unpackedSize":784119,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@polyfea%2fservice-worker@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDrmITXFsnDwkCSiOfkJRsNtRoNIooJf35LJ1aRFpP4cwIhAMS6kxPQ/OPclaXEKCwocU1oa60ldI9zfmcBP4MRbASh"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7322e016-4a1d-4774-a7c5-8467d49488eb"}},"directories":{},"maintainers":[{"name":"milung","email":"milan.kvetko@gmail.com"},{"name":"michalsevcik","email":"michal.sevcik@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/service-worker_0.3.0_1776863297879_0.49371428750647994"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-24T17:29:55.045Z","modified":"2026-04-22T13:08:18.535Z","0.0.2":"2024-05-24T17:29:55.358Z","0.1.0":"2024-05-28T11:42:22.018Z","2.0.5":"2026-04-17T17:50:22.817Z","2.0.6":"2026-04-17T17:54:01.807Z","0.2.0":"2026-04-17T18:08:50.449Z","0.3.0":"2026-04-22T13:08:18.148Z"},"bugs":{"url":"https://github.com/polyfea/service-worker/issues"},"author":{"name":"Polyfea Team"},"license":"Apache-2.0","homepage":"https://github.com/polyfea/service-worker#readme","keywords":["polyfea","service-worker","microfrontend"],"repository":{"type":"git","url":"git+https://github.com/polyfea/service-worker.git"},"description":"Service worker for Polyfea","maintainers":[{"name":"milung","email":"milan.kvetko@gmail.com"},{"name":"michalsevcik","email":"michal.sevcik@protonmail.com"}],"readme":"# Service worker for Polyfea microfrontends\n\nImplements configurable service worker with regular reconcilation of the caching strategies. This allows [Polyfea Controller](https://github.com/polyfea/polyfea-controller) to aggregate caching rules accross multiple mifrofrontends registered in the scope of the single microfrontendClass resource. The service worker is build using the [Workbox](https://developer.chrome.com/docs/workbox) framework.\n\n## Intended usage\n\nAfter installing with\n\n```sh\nnpm install @polyfe/service-worker\n```\n\nthis package provides two module scripts in  `node_modules/@polyfe/service-worker/dist/register.mjs` and `node_modules/@polyfe/service-worker/dist/sw.mjs`. \nBoth are intended to be served by the server at the intended scope (base url) and loaded into html page and service worker.\n\nExample:\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n    <base href=\"/pwa-scope/\">\n    <title>My PWA</title>\n    <link rel=\"manifest\" href=\"manifest.json\">\n    \n    <script type=\"module\" src=\"./@polyfea/service-worker/register.mjs\"></script>\n    <!-- optional configuration of the service worker \n    <meta name=\"polyfea-sw-caching-config\" content=\"./polyfea-caching.json\">\n    <meta name=\"polyfea-sw-reconcile-interval\" content=\"1800000\">\n    -->\n</head>\n<body>\n    ...\n</body>\n```\n\n**Important: sw.mjs must be served on the path that defines its scope, which typically means the base url. In the example above it shall be served from the path `/pwa-scope/sw.mjs`**\n\nThe precaching and runtime caching strategies are loaded and regularly reconciled from the `./polyfea-caching.json` configuration object which implements [Caching](./docs/interfaces/Caching.md). The actual patch to the configuration file and reconcilation period may be defined by metatags as depicted in the example above.\n\nExample of the configuration file:\n\n```json\n{\n    \"precache\": [\n        { \"url\": \"/index.html\", \"revision\": \"1\" }\n    ],\n    \"routes\": [\n        { \"pattern\": \"/api/.*\", \"strategy\": \"network-only\" },\n        { \"pattern\": \"/api/.*\", \"strategy\": \"network-only\", \"method\": \"POST\", \"syncRetentionMinutes\": 60 },  \n        { \"pattern\": \"/test-data/.*\", \"strategy\": \"cache-only\" },\n        { \"pattern\": \".*\", \"strategy\": \"cache-first\", \"maxAgeSeconds\":  86400 }\n    ]\n\n}\n```\n\n## Documentation\n\nThe package may be also bundled into existing project. See [Reference Documentation](./docs/globals.md) for more informations.\n\n## Development\n\nClone and run \n\n```sh\nnpm install\n```\n\nthen start the project by `npm start` and open browser at [http://localhost:3000].\n","readmeFilename":"README.md"}