@mailwoman/tiger 10.0.0 → 10.2.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.
- package/lib/block-group.ts +7 -7
- package/lib/class-code.ts +387 -266
- package/lib/constants.ts +7 -6
- package/lib/county/subdivision.ts +7 -7
- package/lib/{county/index.ts → county.ts} +7 -7
- package/lib/files.ts +37 -20
- package/lib/functional-status.ts +6 -4
- package/lib/geoid.ts +44 -26
- package/lib/index.ts +1 -1
- package/lib/legal-statistical-area.ts +7 -5
- package/lib/{sdk/schema.ts → schema.ts} +32 -42
- package/lib/state.ts +26 -23
- package/lib/tabulation-block.ts +4 -4
- package/lib/tract.ts +3 -3
- package/out/block-group.d.ts +7 -7
- package/out/class-code.d.ts +387 -266
- package/out/class-code.d.ts.map +1 -1
- package/out/class-code.js +387 -266
- package/out/class-code.js.map +1 -1
- package/out/constants.d.ts +7 -6
- package/out/constants.d.ts.map +1 -1
- package/out/constants.js +3 -3
- package/out/county/subdivision.d.ts +7 -7
- package/out/{county/index.d.ts → county.d.ts} +8 -8
- package/out/county.d.ts.map +1 -0
- package/out/{county/index.js → county.js} +2 -2
- package/out/county.js.map +1 -0
- package/out/files.d.ts +21 -13
- package/out/files.d.ts.map +1 -1
- package/out/files.js +27 -13
- package/out/files.js.map +1 -1
- package/out/functional-status.d.ts +6 -4
- package/out/functional-status.d.ts.map +1 -1
- package/out/functional-status.js +6 -4
- package/out/functional-status.js.map +1 -1
- package/out/geoid.d.ts +34 -16
- package/out/geoid.d.ts.map +1 -1
- package/out/geoid.js +16 -10
- package/out/geoid.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -1
- package/out/index.js.map +1 -1
- package/out/legal-statistical-area.d.ts +7 -5
- package/out/legal-statistical-area.d.ts.map +1 -1
- package/out/legal-statistical-area.js +7 -5
- package/out/legal-statistical-area.js.map +1 -1
- package/out/{sdk/schema.d.ts → schema.d.ts} +26 -20
- package/out/schema.d.ts.map +1 -0
- package/out/{sdk/schema.js → schema.js} +12 -31
- package/out/schema.js.map +1 -0
- package/out/sdk/download.d.ts +7 -15
- package/out/sdk/download.d.ts.map +1 -1
- package/out/sdk/download.js +6 -15
- package/out/sdk/download.js.map +1 -1
- package/out/sdk/fetch.d.ts +36 -29
- package/out/sdk/fetch.d.ts.map +1 -1
- package/out/sdk/fetch.js +18 -53
- package/out/sdk/fetch.js.map +1 -1
- package/out/sdk/redistricting.d.ts +29 -15
- package/out/sdk/redistricting.d.ts.map +1 -1
- package/out/sdk/redistricting.js +47 -36
- package/out/sdk/redistricting.js.map +1 -1
- package/out/sdk/state/TIGERTabulatedBlockEntity.d.ts +2 -2
- package/out/sdk/state/TIGERTabulatedBlockEntity.d.ts.map +1 -1
- package/out/sdk/state/TIGERTabulatedBlockEntity.js +3 -3
- package/out/sdk/state/TIGERTabulatedBlockEntity.js.map +1 -1
- package/out/sdk/state/TIGERTractEntity.d.ts.map +1 -1
- package/out/sdk/state/TIGERTractEntity.js.map +1 -1
- package/out/sdk/state/block-operations.d.ts +3 -2
- package/out/sdk/state/block-operations.d.ts.map +1 -1
- package/out/sdk/state/block-operations.js +4 -3
- package/out/sdk/state/block-operations.js.map +1 -1
- package/out/sdk/{state/index.d.ts → state.d.ts} +1 -1
- package/out/sdk/state.d.ts.map +1 -0
- package/out/sdk/{state/index.js → state.js} +1 -1
- package/out/sdk/state.js.map +1 -0
- package/out/sdk/tsconfig.tsbuildinfo +1 -0
- package/out/state.d.ts +18 -15
- package/out/state.d.ts.map +1 -1
- package/out/state.js +17 -14
- package/out/state.js.map +1 -1
- package/out/tabulation-block.d.ts +4 -4
- package/out/tools/race/dots/map.d.ts +23 -9
- package/out/tools/race/dots/map.d.ts.map +1 -1
- package/out/tools/race/dots/map.js +9 -5
- package/out/tools/race/dots/map.js.map +1 -1
- package/out/tools/race/dots.d.ts +47 -0
- package/out/tools/race/dots.d.ts.map +1 -0
- package/out/tools/race/{dots/index.js → dots.js} +10 -27
- package/out/tools/race/dots.js.map +1 -0
- package/out/tools/serve-range.d.ts +13 -7
- package/out/tools/serve-range.d.ts.map +1 -1
- package/out/tools/serve-range.js +10 -8
- package/out/tools/serve-range.js.map +1 -1
- package/out/tools/tsconfig.tsbuildinfo +1 -0
- package/out/tract.d.ts +3 -3
- package/out/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +61 -44
- package/sdk/download.ts +41 -0
- package/{lib/sdk → sdk}/fetch.ts +58 -62
- package/{lib/sdk → sdk}/redistricting.ts +57 -40
- package/{lib/sdk → sdk}/state/TIGERTabulatedBlockEntity.ts +3 -3
- package/{lib/sdk → sdk}/state/block-operations.ts +5 -4
- package/{lib/tools → tools}/race/dots/map.ts +30 -12
- package/{lib/tools/race/dots/index.ts → tools/race/dots.ts} +14 -31
- package/{lib/tools → tools}/serve-range.ts +17 -10
- package/lib/sdk/download.ts +0 -49
- package/lib/sdk/index.ts +0 -10
- package/lib/tools/index.ts +0 -11
- package/out/county/index.d.ts.map +0 -1
- package/out/county/index.js.map +0 -1
- package/out/sdk/index.d.ts +0 -10
- package/out/sdk/index.d.ts.map +0 -1
- package/out/sdk/index.js +0 -10
- package/out/sdk/index.js.map +0 -1
- package/out/sdk/schema.d.ts.map +0 -1
- package/out/sdk/schema.js.map +0 -1
- package/out/sdk/state/index.d.ts.map +0 -1
- package/out/sdk/state/index.js.map +0 -1
- package/out/tools/index.d.ts +0 -11
- package/out/tools/index.d.ts.map +0 -1
- package/out/tools/index.js +0 -11
- package/out/tools/index.js.map +0 -1
- package/out/tools/race/dots/index.d.ts +0 -61
- package/out/tools/race/dots/index.d.ts.map +0 -1
- package/out/tools/race/dots/index.js.map +0 -1
- /package/{lib/sdk → sdk}/state/TIGERTractEntity.ts +0 -0
- /package/{lib/sdk/state/index.ts → sdk/state.ts} +0 -0
package/out/tools/serve-range.js
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Minimal static file server that
|
|
7
|
-
* not
|
|
6
|
+
* Minimal static file server that honors http Range requests (206) — Python's `http.server` does
|
|
7
|
+
* not. PMTiles reads via Range, so this server cannot serve it. Used to preview/render a local
|
|
8
8
|
* `.pmtiles` tileset (e.g. the race-dot map, via `mailwoman tiger race-dots-map --serve`). Not for
|
|
9
|
-
* production
|
|
9
|
+
* production. the deployed tiles go through the tile worker.
|
|
10
10
|
*
|
|
11
11
|
* Internal helper module — no standalone command.
|
|
12
12
|
*/
|
|
13
13
|
import { createServer } from "node:http";
|
|
14
|
-
import {
|
|
14
|
+
import { tempRootPath } from "@mailwoman/core/data-root";
|
|
15
|
+
import { statPath } from "@mailwoman/core/fs/readers/stat";
|
|
15
16
|
import { openReadStream } from "@mailwoman/core/fs/streams";
|
|
16
|
-
import { mailwomanTempRoot } from "@mailwoman/core/utils";
|
|
17
17
|
import { extname, join, normalize } from "path-ts";
|
|
18
18
|
const TYPES = {
|
|
19
19
|
".html": "text/html; charset=utf-8",
|
|
@@ -23,11 +23,13 @@ const TYPES = {
|
|
|
23
23
|
".png": "image/png",
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
* Serve `dir` over localhost with
|
|
27
|
-
*
|
|
26
|
+
* Serve `dir` over localhost with http Range support.
|
|
27
|
+
*
|
|
28
|
+
* Resolves once the server is listening.
|
|
29
|
+
* The caller owns the lifetime (dispose it to stop. Commands typically hold the process open instead).
|
|
28
30
|
*/
|
|
29
31
|
export async function serveWithRangeSupport(options = {}, report) {
|
|
30
|
-
const dir = options.dir ||
|
|
32
|
+
const dir = options.dir || tempRootPath();
|
|
31
33
|
const port = options.port ?? 8899;
|
|
32
34
|
const server = createServer(async (req, res) => {
|
|
33
35
|
const rel = normalize(decodeURIComponent((req.url || "/").split("?")[0])).replace(/^(\.\.[/\\])+/, "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-range.js","sourceR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