@mailwoman/registry 10.5.0 → 10.7.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.
@@ -3,14 +3,10 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The shared headless-Chromium harness behind the `registry viz` renderers (an internal helper rather than a command). The WebGL consumers (Plotly 3D, MapLibre) get no GPU in headless Chromium, so
7
- * the browser launches on angle's SwiftShader software rasterizer (`--use-gl=angle
8
- * --use-angle=swiftshader --enable-unsafe-swiftshader`); each caller owns its own navigation +
9
- * wait strategy and screenshots inside the callback.
10
- *
11
- * Playwright (headless Chromium) is a heavy dev-only dependency — lazy-imported at call time (the
12
- * corpus-tools lazy-import convention), so importing `@mailwoman/registry/tools` never pays for
13
- * it.
6
+ * This module configures the shared browser for Plotly and MapLibre rendering.
7
+ * SwiftShader supplies WebGL without a hardware GPU.
8
+ * Each caller owns navigation, readiness checks, and screenshots.
9
+ * The browser package loads Playwright and stealth plugins when a session starts.
14
10
  */
15
11
  import type { Page } from "playwright";
16
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../tools/viz/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACvC,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAiBjD"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../tools/viz/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACvC,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAUjD"}
@@ -3,15 +3,12 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The shared headless-Chromium harness behind the `registry viz` renderers (an internal helper rather than a command). The WebGL consumers (Plotly 3D, MapLibre) get no GPU in headless Chromium, so
7
- * the browser launches on angle's SwiftShader software rasterizer (`--use-gl=angle
8
- * --use-angle=swiftshader --enable-unsafe-swiftshader`); each caller owns its own navigation +
9
- * wait strategy and screenshots inside the callback.
10
- *
11
- * Playwright (headless Chromium) is a heavy dev-only dependency — lazy-imported at call time (the
12
- * corpus-tools lazy-import convention), so importing `@mailwoman/registry/tools` never pays for
13
- * it.
6
+ * This module configures the shared browser for Plotly and MapLibre rendering.
7
+ * SwiftShader supplies WebGL without a hardware GPU.
8
+ * Each caller owns navigation, readiness checks, and screenshots.
9
+ * The browser package loads Playwright and stealth plugins when a session starts.
14
10
  */
11
+ import { withBrowserPage } from "@mailwoman/browser";
15
12
  /**
16
13
  * Launch headless Chromium (SwiftShader WebGL), open one page at `deviceScaleFactor: 2`,
17
14
  * collect console + page errors, run `fn`, and dispose the browser.
@@ -19,16 +16,11 @@
19
16
  * The callback owns navigation, waits and the screenshot.
20
17
  */
21
18
  export async function withChromiumPage(options, fn) {
22
- const { chromium } = await import("playwright");
23
- const browser = await chromium.launch({
24
- args: ["--use-gl=angle", "--use-angle=swiftshader", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist"],
25
- });
26
- const page = await browser.newPage({ viewport: options.viewport, deviceScaleFactor: 2 });
27
- const errors = [];
28
- page.on("console", (m) => m.type() === "error" && errors.push(m.text()));
29
- page.on("pageerror", (e) => errors.push(String(e)));
30
- const result = await fn(page);
31
- await browser[Symbol.asyncDispose]();
32
- return { result, consoleErrors: errors };
19
+ return withBrowserPage({
20
+ launchOptions: {
21
+ args: ["--use-gl=angle", "--use-angle=swiftshader", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist"],
22
+ },
23
+ contextOptions: { viewport: options.viewport, deviceScaleFactor: 2 },
24
+ }, fn);
33
25
  }
34
26
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../tools/viz/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAWH;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,OAA4B,EAC5B,EAA8B;IAE9B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAA;IAE/C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACrC,IAAI,EAAE,CAAC,gBAAgB,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,wBAAwB,CAAC;KAC5G,CAAC,CAAA;IAEF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAA;IAExF,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACxE,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEnD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAA;IAEpC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,CAAA;AACzC,CAAC"}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../tools/viz/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAUpD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,OAA4B,EAC5B,EAA8B;IAE9B,OAAO,eAAe,CACrB;QACC,aAAa,EAAE;YACd,IAAI,EAAE,CAAC,gBAAgB,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,wBAAwB,CAAC;SAC5G;QACD,cAAc,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC,EAAE;KACpE,EACD,EAAE,CACF,CAAA;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailwoman/registry",
3
- "version": "10.5.0",
3
+ "version": "10.7.0",
4
4
  "description": "The geocode-first record-matching application: resolve messy contact/organization records into canonical, geocoded entities (block → score → cluster) and export them as GeoJSON for spatial analysis. The clinic-funding use case mailwoman was built for.",
5
5
  "license": "AGPL-3.0-only OR LicenseRef-Commercial",
6
6
  "repository": {
@@ -95,19 +95,20 @@
95
95
  }
96
96
  },
97
97
  "dependencies": {
98
- "@mailwoman/address-id": "10.5.0",
99
- "@mailwoman/annotations": "10.5.0",
100
- "@mailwoman/core": "10.5.0",
101
- "@mailwoman/match": "10.5.0",
102
- "@mailwoman/record": "10.5.0",
103
- "@mailwoman/resolver-wof-sqlite": "10.5.0",
104
- "@mailwoman/spatial": "10.5.0",
105
- "@mailwoman/sqlite": "10.5.0",
98
+ "@mailwoman/address-id": "10.7.0",
99
+ "@mailwoman/annotations": "10.7.0",
100
+ "@mailwoman/core": "10.7.0",
101
+ "@mailwoman/match": "10.7.0",
102
+ "@mailwoman/record": "10.7.0",
103
+ "@mailwoman/resolver-wof-sqlite": "10.7.0",
104
+ "@mailwoman/spatial": "10.7.0",
105
+ "@mailwoman/sqlite": "10.7.0",
106
106
  "@protomaps/basemaps": "^5.7.2",
107
107
  "h3-js": "^4.5.0",
108
108
  "spliterator": "^9.2.1"
109
109
  },
110
110
  "devDependencies": {
111
+ "@mailwoman/browser": "10.5.0",
111
112
  "@types/node": "^26.6.4",
112
113
  "path-ts": "^2.5.0",
113
114
  "playwright": "^1.63.0"
@@ -3,16 +3,13 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The shared headless-Chromium harness behind the `registry viz` renderers (an internal helper rather than a command). The WebGL consumers (Plotly 3D, MapLibre) get no GPU in headless Chromium, so
7
- * the browser launches on angle's SwiftShader software rasterizer (`--use-gl=angle
8
- * --use-angle=swiftshader --enable-unsafe-swiftshader`); each caller owns its own navigation +
9
- * wait strategy and screenshots inside the callback.
10
- *
11
- * Playwright (headless Chromium) is a heavy dev-only dependency — lazy-imported at call time (the
12
- * corpus-tools lazy-import convention), so importing `@mailwoman/registry/tools` never pays for
13
- * it.
6
+ * This module configures the shared browser for Plotly and MapLibre rendering.
7
+ * SwiftShader supplies WebGL without a hardware GPU.
8
+ * Each caller owns navigation, readiness checks, and screenshots.
9
+ * The browser package loads Playwright and stealth plugins when a session starts.
14
10
  */
15
11
 
12
+ import { withBrowserPage } from "@mailwoman/browser"
16
13
  import type { Page } from "playwright"
17
14
 
18
15
  /**
@@ -32,20 +29,13 @@ export async function withChromiumPage<T>(
32
29
  options: ChromiumPageOptions,
33
30
  fn: (page: Page) => Promise<T>
34
31
  ): Promise<{ result: T; consoleErrors: string[] }> {
35
- const { chromium } = await import("playwright")
36
-
37
- const browser = await chromium.launch({
38
- args: ["--use-gl=angle", "--use-angle=swiftshader", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist"],
39
- })
40
-
41
- const page = await browser.newPage({ viewport: options.viewport, deviceScaleFactor: 2 })
42
-
43
- const errors: string[] = []
44
- page.on("console", (m) => m.type() === "error" && errors.push(m.text()))
45
- page.on("pageerror", (e) => errors.push(String(e)))
46
-
47
- const result = await fn(page)
48
- await browser[Symbol.asyncDispose]()
49
-
50
- return { result, consoleErrors: errors }
32
+ return withBrowserPage(
33
+ {
34
+ launchOptions: {
35
+ args: ["--use-gl=angle", "--use-angle=swiftshader", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist"],
36
+ },
37
+ contextOptions: { viewport: options.viewport, deviceScaleFactor: 2 },
38
+ },
39
+ fn
40
+ )
51
41
  }