changeset 684:b39d24617a85

fixes for streamedgraph build and a surprise with multi-value wifiBands Ignore-this: eea822327a0c66c4462ffd7c404079e5
author drewp@bigasterisk.com
date Thu, 09 Jan 2020 00:38:59 -0800
parents 50d66febeeb0
children 7c5953801cf1
files service/wifi/rollup.config.js service/wifi/src/index.ts
diffstat 2 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/service/wifi/rollup.config.js	Mon Jan 06 23:47:30 2020 -0800
+++ b/service/wifi/rollup.config.js	Thu Jan 09 00:38:59 2020 -0800
@@ -6,6 +6,12 @@
 
 const workaround_jsonld_module_system_picker = "process = {version: '1.0.0'}";
 const workaround_some_browser_detector = "global = window";
+const workaround_jsonld_expand_issue = {
+  namedExports: {
+    jsonld: ["expand"], // fixes "expand is not exported by node_modules/jsonld/lib/index.js"
+    '../../../streamed-graph/node_modules/jsonld/lib/index': ['expand'],
+  }
+};
 
 // This makes <dom-module> element totally unavailable. I only meant to prune one of the
 // two, but of course why is streamed-graph's node_modules/**/dom-module.js file getting 
@@ -32,11 +38,7 @@
       browser: true,
     }),
     typescript(),
-    commonjs({
-      namedExports: {
-        jsonld: ["expand"], // fixes "expand is not exported by node_modules/jsonld/lib/index.js"
-      },
-    }),
+    commonjs(workaround_jsonld_expand_issue),
     replace({ ...replacements, delimiters: ["", ""] }),
   ],
 };
--- a/service/wifi/src/index.ts	Mon Jan 06 23:47:30 2020 -0800
+++ b/service/wifi/src/index.ts	Thu Jan 09 00:38:59 2020 -0800
@@ -6,7 +6,7 @@
 
 import { Literal, N3Store } from "n3";
 import { NamedNode, DataFactory } from "n3";
-const { namedNode } = DataFactory;
+const { namedNode, literal } = DataFactory;
 
 import { VersionedGraph } from "streamed-graph";
 import { style } from "./style";
@@ -184,7 +184,13 @@
       bytesPerSecDisplay: bytesPerSec + " B/s",
     };
 
-    const wifiBand = graphUriValue(store, devUri, room + "wifiBand");
+    let wifiBand;
+    try {
+      wifiBand = graphUriValue(store, devUri, room + "wifiBand");
+    } catch (e) {
+      wifiBand = namedNode("multi"); // some have 5G and 2G?
+    }
+    
     const connectedToAp = graphUriValue(store, devUri, room + "connectedToAp");
     if (!this.showGroups || connectedToAp) {
       const key = this.showGroups