skillet-shared 0.8.0 → 0.9.0

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.
@@ -1 +1 @@
1
- export declare function startAnalytics(): void;
1
+ export declare function startAnalytics(site?: string): void;
package/dist/analytics.js CHANGED
@@ -1,9 +1,10 @@
1
1
  // A hit counter on every page the site serves. GoatCounter counts page views
2
2
  // and sets no cookies, so no page asks first; /privacy/ says what it collects.
3
- const COUNTER = 'https://cmdcolin.goatcounter.com/count';
3
+ // Each app passes the code of its own GoatCounter site.
4
+ const counter = (site) => `https://${site}.goatcounter.com/count`;
4
5
  // A browser a script is driving counts nothing: the harnesses that screenshot
5
6
  // and record these pages are nobody's visit.
6
- export function startAnalytics() {
7
+ export function startAnalytics(site = 'cmdcolin') {
7
8
  if (navigator.webdriver)
8
9
  return;
9
10
  if (document.querySelector('script[data-goatcounter]'))
@@ -11,6 +12,6 @@ export function startAnalytics() {
11
12
  const tag = document.createElement('script');
12
13
  tag.async = true;
13
14
  tag.src = 'https://gc.zgo.at/count.js';
14
- tag.dataset.goatcounter = COUNTER;
15
+ tag.dataset.goatcounter = counter(site);
15
16
  document.head.append(tag);
16
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillet-shared",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Code shared by bender and videoskillet",
5
5
  "license": "MIT",
6
6
  "author": "Colin Diesh",