@mailwoman/tiger 9.4.0 → 10.1.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 → county/subdivision.ts} +7 -7
- package/lib/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 +23 -20
- 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 → county/subdivision.d.ts} +8 -8
- package/out/county/subdivision.d.ts.map +1 -0
- package/out/{county-subdivision.js → county/subdivision.js} +1 -1
- package/out/county/subdivision.js.map +1 -0
- package/out/county.d.ts +7 -7
- package/out/county.js +1 -1
- 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.js +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 +5 -14
- package/out/sdk/download.js.map +1 -1
- package/out/sdk/fetch.d.ts +32 -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 +45 -42
- 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 → race/dots/map.d.ts} +24 -10
- package/out/tools/race/dots/map.d.ts.map +1 -0
- package/out/tools/{race-dots-map.js → race/dots/map.js} +10 -6
- package/out/tools/race/dots/map.js.map +1 -0
- package/out/tools/race/dots.d.ts +47 -0
- package/out/tools/race/dots.d.ts.map +1 -0
- package/out/tools/{race-dots.js → race/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 +9 -7
- 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 +59 -42
- package/sdk/download.ts +41 -0
- package/{lib/sdk → sdk}/fetch.ts +54 -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/race-dots-map.ts → tools/race/dots/map.ts} +30 -12
- package/{lib/tools/race-dots.ts → tools/race/dots.ts} +14 -31
- package/{lib/tools → tools}/serve-range.ts +15 -9
- package/lib/sdk/download.ts +0 -49
- package/lib/sdk/index.ts +0 -10
- package/lib/tools/index.ts +0 -11
- package/out/county-subdivision.d.ts.map +0 -1
- package/out/county-subdivision.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-map.d.ts.map +0 -1
- package/out/tools/race-dots-map.js.map +0 -1
- package/out/tools/race-dots.d.ts +0 -61
- package/out/tools/race-dots.d.ts.map +0 -1
- package/out/tools/race-dots.js.map +0 -1
- /package/{lib/sdk → sdk}/state/TIGERTractEntity.ts +0 -0
- /package/{lib/sdk/state/index.ts → sdk/state.ts} +0 -0
|
@@ -3,10 +3,10 @@
|
|
|
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
|
*/
|
|
@@ -16,11 +16,15 @@ import { type Server } from "node:http";
|
|
|
16
16
|
*/
|
|
17
17
|
export interface ServeRangeOptions {
|
|
18
18
|
/**
|
|
19
|
-
* Directory to serve.
|
|
19
|
+
* Directory to serve.
|
|
20
|
+
*
|
|
21
|
+
* Default `/tmp`.
|
|
20
22
|
*/
|
|
21
23
|
dir?: string;
|
|
22
24
|
/**
|
|
23
|
-
* Port to listen on.
|
|
25
|
+
* Port to listen on.
|
|
26
|
+
*
|
|
27
|
+
* Default 8899.
|
|
24
28
|
*/
|
|
25
29
|
port?: number;
|
|
26
30
|
}
|
|
@@ -33,8 +37,10 @@ export interface RangeServer extends AsyncDisposable {
|
|
|
33
37
|
server: Server;
|
|
34
38
|
}
|
|
35
39
|
/**
|
|
36
|
-
* Serve `dir` over localhost with
|
|
37
|
-
*
|
|
40
|
+
* Serve `dir` over localhost with http Range support.
|
|
41
|
+
*
|
|
42
|
+
* Resolves once the server is listening.
|
|
43
|
+
* The caller owns the lifetime (dispose it to stop. Commands typically hold the process open instead).
|
|
38
44
|
*/
|
|
39
45
|
export declare function serveWithRangeSupport(options?: ServeRangeOptions, report?: (line: string) => void): Promise<RangeServer>;
|
|
40
46
|
//# sourceMappingURL=serve-range.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-range.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"serve-range.d.ts","sourceRoot":"","sources":["../../tools/serve-range.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAsC,KAAK,MAAM,EAAuB,MAAM,WAAW,CAAA;AAOhG;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IACnD,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACd;AAUD;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAC1C,OAAO,GAAE,iBAAsB,EAC/B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,WAAW,CAAC,CAqDtB"}
|
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 { tempRootPath } from "@mailwoman/core/data-root";
|
|
14
15
|
import { statPath } from "@mailwoman/core/fs/readers";
|
|
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","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"serve-range.js","sourceRoot":"","sources":["../../tools/serve-range.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAA;AAEhG,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AA6BlD,MAAM,KAAK,GAA2B;IACrC,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,kBAAkB;IAC3B,UAAU,E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