@things-factory/shell 8.0.64 → 8.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/index.js CHANGED
@@ -8,6 +8,20 @@ export const PROCESS = {
8
8
  'NODE-ENV': process.env['NODE-ENV']
9
9
  }
10
10
 
11
+ /* Service Worker: production only */
12
+ if (process.env['NODE-ENV'] === 'production') {
13
+ if ('serviceWorker' in navigator) {
14
+ navigator.serviceWorker.register('/service-worker.js', { scope: '/' })
15
+ }
16
+ } else {
17
+ /* Development: unregister stale service workers so code changes reflect immediately */
18
+ if ('serviceWorker' in navigator) {
19
+ navigator.serviceWorker.getRegistrations().then(registrations => {
20
+ registrations.forEach(r => r.unregister())
21
+ })
22
+ }
23
+ }
24
+
11
25
  /* Export APIs */
12
26
 
13
27
  // store, actions, page-view,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/shell",
3
- "version": "8.0.64",
3
+ "version": "8.0.86",
4
4
  "description": "Core module for framework",
5
5
  "bin": {
6
6
  "things-factory": "bin/things-factory",
@@ -134,5 +134,5 @@
134
134
  "pg": "^8.7.3",
135
135
  "sqlite3": "^5.0.8"
136
136
  },
137
- "gitHead": "e7e5f6dc93f372f8ccc8aa406246f7a37795b53b"
137
+ "gitHead": "28e364938d499b32aed41a8c664a8a2957b09b69"
138
138
  }
package/static/index.js CHANGED
@@ -1,5 +1 @@
1
- if ('serviceWorker' in navigator) {
2
- navigator.serviceWorker.register('/service-worker.js', {
3
- scope: '/'
4
- })
5
- }
1
+ /* Service Worker registration moved to the webpack bundle (client/index.js) for environment-aware control. */