@mailwoman/activity-lexicon 0.0.0 → 9.3.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/README.md +1 -1
- package/data/activity-lexicon.json +4 -4
- package/{index.ts → lib/index.ts} +2 -2
- package/{lexicon.ts → lib/lexicon.ts} +13 -40
- package/{types.ts → lib/types.ts} +1 -1
- package/out/index.d.ts +2 -2
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -1
- package/out/index.js.map +1 -1
- package/out/lexicon.d.ts +7 -9
- package/out/lexicon.d.ts.map +1 -1
- package/out/lexicon.js +12 -35
- package/out/lexicon.js.map +1 -1
- package/out/types.d.ts +1 -1
- package/out/types.d.ts.map +1 -1
- package/out/types.js.map +1 -1
- package/package.json +29 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Every entry belongs to one of four attestation classes — a committed query, a
|
|
|
10
10
|
|
|
11
11
|
## Release posture
|
|
12
12
|
|
|
13
|
-
**Do not depend on
|
|
13
|
+
**Do not depend on version `0.0.0`.** It exists to establish the package name. The first supported release ships with the next coordinated mailwoman release, and the API is unstable until a `1.x`.
|
|
14
14
|
|
|
15
15
|
## License
|
|
16
16
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"source": "curated",
|
|
16
16
|
"attestation": {
|
|
17
17
|
"kind": "committed-query",
|
|
18
|
-
"reference": "packages/mailwoman/eval-harness/fixtures/poi-board.jsonl#sem-act-us-02",
|
|
18
|
+
"reference": "packages/mailwoman/lib/eval-harness/fixtures/poi-board.jsonl#sem-act-us-02",
|
|
19
19
|
"detail": "prescription near Denver CO"
|
|
20
20
|
},
|
|
21
21
|
"note": "The bare activity noun. Unscoped because the row that attests it carries no locale, and scoping a committed form past its own attestation would make the entry say more than the record does."
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"source": "curated",
|
|
34
34
|
"attestation": {
|
|
35
35
|
"kind": "committed-query",
|
|
36
|
-
"reference": "packages/mailwoman/eval-harness/fixtures/poi-board.jsonl#sem-act-us-01",
|
|
36
|
+
"reference": "packages/mailwoman/lib/eval-harness/fixtures/poi-board.jsonl#sem-act-us-01",
|
|
37
37
|
"detail": "where can i pick up a prescription near Denver CO"
|
|
38
38
|
},
|
|
39
39
|
"note": "The verb phrase for collecting a dispensed prescription."
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"source": "curated",
|
|
56
56
|
"attestation": {
|
|
57
57
|
"kind": "committed-query",
|
|
58
|
-
"reference": "packages/mailwoman/eval-harness/fixtures/poi-board.jsonl#sem-act-fr-01",
|
|
58
|
+
"reference": "packages/mailwoman/lib/eval-harness/fixtures/poi-board.jsonl#sem-act-fr-01",
|
|
59
59
|
"detail": "somewhere to fill a prescription near Toulouse"
|
|
60
60
|
},
|
|
61
61
|
"note": "The verb phrase for having a prescription dispensed."
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"source": "curated",
|
|
67
67
|
"attestation": {
|
|
68
68
|
"kind": "committed-query",
|
|
69
|
-
"reference": "packages/mailwoman/eval-harness/fixtures/poi-board.jsonl#sem-act-mx-01",
|
|
69
|
+
"reference": "packages/mailwoman/lib/eval-harness/fixtures/poi-board.jsonl#sem-act-mx-01",
|
|
70
70
|
"detail": "i need my prescription refilled near Tijuana"
|
|
71
71
|
},
|
|
72
72
|
"note": "The inflected form, as it appears inside a first-person sentence."
|
|
@@ -17,18 +17,20 @@
|
|
|
17
17
|
* produces a lexicon that looks complete and is short, and a consumer measuring recognition breadth would read the
|
|
18
18
|
* shortfall as the world rather than as the file. So {@linkcode readActivityLexicon} throws.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
20
|
+
* A LIGHT GRAPH, deliberately: a vocabulary any package may read must not drag one behind it — only
|
|
21
|
+
* `@mailwoman/core`'s file plumbing and `@mailwoman/variant-aliases`' locale-scope rule come along.
|
|
21
22
|
*/
|
|
22
23
|
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
24
|
+
import { readLocalJSONFile } from "@mailwoman/core/fs/readers"
|
|
25
|
+
import { resolvePackagedDataPath } from "@mailwoman/core/module/packaged-data"
|
|
26
|
+
import { resolveLocaleScope } from "@mailwoman/variant-aliases"
|
|
25
27
|
|
|
26
28
|
import type {
|
|
27
29
|
ActivityPhraseEntry,
|
|
28
30
|
ActivityPhraseLexicon,
|
|
29
31
|
ActivityPhraseLocaleMatch,
|
|
30
32
|
ActivityPhraseDerivation,
|
|
31
|
-
} from "
|
|
33
|
+
} from "#types"
|
|
32
34
|
|
|
33
35
|
const moduleDir = import.meta.dirname
|
|
34
36
|
|
|
@@ -38,26 +40,9 @@ const moduleDir = import.meta.dirname
|
|
|
38
40
|
const DERIVATIONS: ReadonlyArray<ActivityPhraseDerivation> = ["plural", "nominalization", "verb-phrase", "possessive"]
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
|
-
* The committed lexicon
|
|
42
|
-
*
|
|
43
|
-
* `data/` sits at the package root (it is a `files` entry), and this module sits either at that root — running from
|
|
44
|
-
* source — or under `out/` when compiled, so there are exactly two places to look. Probing for the FILE rather than
|
|
45
|
-
* attempting a parse keeps a corrupt lexicon from reading as an absent one.
|
|
43
|
+
* The committed lexicon, located by the shared source-tree/`out/` probe in `@mailwoman/core/module/packaged-data`.
|
|
46
44
|
*/
|
|
47
|
-
export const ACTIVITY_LEXICON_PATH: string = (
|
|
48
|
-
const candidates = [
|
|
49
|
-
resolve(moduleDir, "data", "activity-lexicon.json"),
|
|
50
|
-
resolve(moduleDir, "..", "data", "activity-lexicon.json"),
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
const found = candidates.find((candidate) => existsSync(candidate))
|
|
54
|
-
|
|
55
|
-
if (!found) {
|
|
56
|
-
throw new Error(`activity-lexicon: could not find data/activity-lexicon.json — looked in ${candidates.join(", ")}`)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return found
|
|
60
|
-
})()
|
|
45
|
+
export const ACTIVITY_LEXICON_PATH: string = await resolvePackagedDataPath(moduleDir, "activity-lexicon.json")
|
|
61
46
|
|
|
62
47
|
/**
|
|
63
48
|
* Normalize a phrase for comparison: NFKC, trimmed, whitespace collapsed, lowercased.
|
|
@@ -71,7 +56,8 @@ export function normalizeActivityPhrase(phrase: string): string {
|
|
|
71
56
|
}
|
|
72
57
|
|
|
73
58
|
/**
|
|
74
|
-
* Decide whether an entry answers under a locale,
|
|
59
|
+
* Decide whether an entry answers under a locale, delegating to `@mailwoman/variant-aliases`'
|
|
60
|
+
* {@linkcode resolveLocaleScope} — the owner of these semantics.
|
|
75
61
|
*
|
|
76
62
|
* A scoped entry does not match when the locale is unknown. That is the containment: a phrasing declared regional
|
|
77
63
|
* cannot be reached without knowing the region, or the record means something different from what it says.
|
|
@@ -80,17 +66,7 @@ export function resolveActivityPhraseLocale(
|
|
|
80
66
|
entry: ActivityPhraseEntry,
|
|
81
67
|
locale: string | undefined
|
|
82
68
|
): ActivityPhraseLocaleMatch | null {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (!locale) return null
|
|
86
|
-
|
|
87
|
-
if (entry.locales.includes(locale)) return { scope: "exact", confidence: 1 }
|
|
88
|
-
|
|
89
|
-
const language = locale.split(/[-_]/)[0]
|
|
90
|
-
|
|
91
|
-
if (entry.locales.some((tag) => tag.split(/[-_]/)[0] === language)) return { scope: "language", confidence: 0.5 }
|
|
92
|
-
|
|
93
|
-
return null
|
|
69
|
+
return resolveLocaleScope(entry.locales, locale)
|
|
94
70
|
}
|
|
95
71
|
|
|
96
72
|
/**
|
|
@@ -230,13 +206,10 @@ let committed: ActivityPhraseLexicon | undefined
|
|
|
230
206
|
*
|
|
231
207
|
* The committed read is memoized; an explicit path is read fresh, which is what a test asserting a refusal needs.
|
|
232
208
|
*/
|
|
233
|
-
export function readActivityLexicon(path: string = ACTIVITY_LEXICON_PATH): ActivityPhraseLexicon {
|
|
209
|
+
export async function readActivityLexicon(path: string = ACTIVITY_LEXICON_PATH): Promise<ActivityPhraseLexicon> {
|
|
234
210
|
if (path === ACTIVITY_LEXICON_PATH && committed) return committed
|
|
235
211
|
|
|
236
|
-
|
|
237
|
-
// `@mailwoman/core`'s parse wrappers are deliberately out of reach.
|
|
238
|
-
// oxlint-disable-next-line no-restricted-properties -- zero-dependency leaf; corrupt shipped data must throw with its offset
|
|
239
|
-
const lexicon = JSON.parse(readFileSync(path, "utf8")) as ActivityPhraseLexicon
|
|
212
|
+
const lexicon = await readLocalJSONFile<ActivityPhraseLexicon>(path)
|
|
240
213
|
const problems = auditActivityLexicon(lexicon)
|
|
241
214
|
|
|
242
215
|
if (problems.length) {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* Where a record came from. Field-for-field the shape `@mailwoman/geographic-model` uses for its own provenance, so a
|
|
21
21
|
* consumer carrying both never has to translate between two spellings of the same idea. It is restated rather than
|
|
22
|
-
* imported because this package
|
|
22
|
+
* imported because this package does not depend on `@mailwoman/geographic-model`.
|
|
23
23
|
*/
|
|
24
24
|
export interface ActivityLexiconProvenance {
|
|
25
25
|
/**
|
package/out/index.d.ts
CHANGED
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
* which country and on whose authority live in `@mailwoman/geographic-model`; which venue nouns name a POI category
|
|
11
11
|
* live in `@mailwoman/poi-taxonomy`. A consumer joins them; none of the three restates another.
|
|
12
12
|
*/
|
|
13
|
-
export { ACTIVITY_LEXICON_PATH, auditActivityLexicon, normalizeActivityPhrase, readActivityLexicon, resolveActivityPhraseLocale, } from "
|
|
14
|
-
export type * from "
|
|
13
|
+
export { ACTIVITY_LEXICON_PATH, auditActivityLexicon, normalizeActivityPhrase, readActivityLexicon, resolveActivityPhraseLocale, } from "#lexicon";
|
|
14
|
+
export type * from "#types";
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,GAC3B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,GAC3B,MAAM,UAAU,CAAA;AAEjB,mBAAmB,QAAQ,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
* which country and on whose authority live in `@mailwoman/geographic-model`; which venue nouns name a POI category
|
|
11
11
|
* live in `@mailwoman/poi-taxonomy`. A consumer joins them; none of the three restates another.
|
|
12
12
|
*/
|
|
13
|
-
export { ACTIVITY_LEXICON_PATH, auditActivityLexicon, normalizeActivityPhrase, readActivityLexicon, resolveActivityPhraseLocale, } from "
|
|
13
|
+
export { ACTIVITY_LEXICON_PATH, auditActivityLexicon, normalizeActivityPhrase, readActivityLexicon, resolveActivityPhraseLocale, } from "#lexicon";
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,GAC3B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,GAC3B,MAAM,UAAU,CAAA"}
|
package/out/lexicon.d.ts
CHANGED
|
@@ -17,15 +17,12 @@
|
|
|
17
17
|
* produces a lexicon that looks complete and is short, and a consumer measuring recognition breadth would read the
|
|
18
18
|
* shortfall as the world rather than as the file. So {@linkcode readActivityLexicon} throws.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
20
|
+
* A LIGHT GRAPH, deliberately: a vocabulary any package may read must not drag one behind it — only
|
|
21
|
+
* `@mailwoman/core`'s file plumbing and `@mailwoman/variant-aliases`' locale-scope rule come along.
|
|
21
22
|
*/
|
|
22
|
-
import type { ActivityPhraseEntry, ActivityPhraseLexicon, ActivityPhraseLocaleMatch } from "
|
|
23
|
+
import type { ActivityPhraseEntry, ActivityPhraseLexicon, ActivityPhraseLocaleMatch } from "#types";
|
|
23
24
|
/**
|
|
24
|
-
* The committed lexicon
|
|
25
|
-
*
|
|
26
|
-
* `data/` sits at the package root (it is a `files` entry), and this module sits either at that root — running from
|
|
27
|
-
* source — or under `out/` when compiled, so there are exactly two places to look. Probing for the FILE rather than
|
|
28
|
-
* attempting a parse keeps a corrupt lexicon from reading as an absent one.
|
|
25
|
+
* The committed lexicon, located by the shared source-tree/`out/` probe in `@mailwoman/core/module/packaged-data`.
|
|
29
26
|
*/
|
|
30
27
|
export declare const ACTIVITY_LEXICON_PATH: string;
|
|
31
28
|
/**
|
|
@@ -37,7 +34,8 @@ export declare const ACTIVITY_LEXICON_PATH: string;
|
|
|
37
34
|
*/
|
|
38
35
|
export declare function normalizeActivityPhrase(phrase: string): string;
|
|
39
36
|
/**
|
|
40
|
-
* Decide whether an entry answers under a locale,
|
|
37
|
+
* Decide whether an entry answers under a locale, delegating to `@mailwoman/variant-aliases`'
|
|
38
|
+
* {@linkcode resolveLocaleScope} — the owner of these semantics.
|
|
41
39
|
*
|
|
42
40
|
* A scoped entry does not match when the locale is unknown. That is the containment: a phrasing declared regional
|
|
43
41
|
* cannot be reached without knowing the region, or the record means something different from what it says.
|
|
@@ -56,5 +54,5 @@ export declare function auditActivityLexicon(lexicon: ActivityPhraseLexicon): st
|
|
|
56
54
|
*
|
|
57
55
|
* The committed read is memoized; an explicit path is read fresh, which is what a test asserting a refusal needs.
|
|
58
56
|
*/
|
|
59
|
-
export declare function readActivityLexicon(path?: string): ActivityPhraseLexicon
|
|
57
|
+
export declare function readActivityLexicon(path?: string): Promise<ActivityPhraseLexicon>;
|
|
60
58
|
//# sourceMappingURL=lexicon.d.ts.map
|
package/out/lexicon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicon.d.ts","sourceRoot":"","sources":["../lexicon.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lexicon.d.ts","sourceRoot":"","sources":["../lib/lexicon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,KAAK,EACX,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EAEzB,MAAM,QAAQ,CAAA;AASf;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAA0E,CAAA;AAE9G;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,GACxB,yBAAyB,GAAG,IAAI,CAElC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,EAAE,CA+C7E;AA8ED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,GAAE,MAA8B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAiB9G"}
|
package/out/lexicon.js
CHANGED
|
@@ -17,33 +17,21 @@
|
|
|
17
17
|
* produces a lexicon that looks complete and is short, and a consumer measuring recognition breadth would read the
|
|
18
18
|
* shortfall as the world rather than as the file. So {@linkcode readActivityLexicon} throws.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
20
|
+
* A LIGHT GRAPH, deliberately: a vocabulary any package may read must not drag one behind it — only
|
|
21
|
+
* `@mailwoman/core`'s file plumbing and `@mailwoman/variant-aliases`' locale-scope rule come along.
|
|
21
22
|
*/
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
23
|
+
import { readLocalJSONFile } from "@mailwoman/core/fs/readers";
|
|
24
|
+
import { resolvePackagedDataPath } from "@mailwoman/core/module/packaged-data";
|
|
25
|
+
import { resolveLocaleScope } from "@mailwoman/variant-aliases";
|
|
24
26
|
const moduleDir = import.meta.dirname;
|
|
25
27
|
/**
|
|
26
28
|
* Every derivation the closed list admits, for the audit.
|
|
27
29
|
*/
|
|
28
30
|
const DERIVATIONS = ["plural", "nominalization", "verb-phrase", "possessive"];
|
|
29
31
|
/**
|
|
30
|
-
* The committed lexicon
|
|
31
|
-
*
|
|
32
|
-
* `data/` sits at the package root (it is a `files` entry), and this module sits either at that root — running from
|
|
33
|
-
* source — or under `out/` when compiled, so there are exactly two places to look. Probing for the FILE rather than
|
|
34
|
-
* attempting a parse keeps a corrupt lexicon from reading as an absent one.
|
|
32
|
+
* The committed lexicon, located by the shared source-tree/`out/` probe in `@mailwoman/core/module/packaged-data`.
|
|
35
33
|
*/
|
|
36
|
-
export const ACTIVITY_LEXICON_PATH = (
|
|
37
|
-
const candidates = [
|
|
38
|
-
resolve(moduleDir, "data", "activity-lexicon.json"),
|
|
39
|
-
resolve(moduleDir, "..", "data", "activity-lexicon.json"),
|
|
40
|
-
];
|
|
41
|
-
const found = candidates.find((candidate) => existsSync(candidate));
|
|
42
|
-
if (!found) {
|
|
43
|
-
throw new Error(`activity-lexicon: could not find data/activity-lexicon.json — looked in ${candidates.join(", ")}`);
|
|
44
|
-
}
|
|
45
|
-
return found;
|
|
46
|
-
})();
|
|
34
|
+
export const ACTIVITY_LEXICON_PATH = await resolvePackagedDataPath(moduleDir, "activity-lexicon.json");
|
|
47
35
|
/**
|
|
48
36
|
* Normalize a phrase for comparison: NFKC, trimmed, whitespace collapsed, lowercased.
|
|
49
37
|
*
|
|
@@ -55,22 +43,14 @@ export function normalizeActivityPhrase(phrase) {
|
|
|
55
43
|
return phrase.normalize("NFKC").trim().replaceAll(/\s+/g, " ").toLowerCase();
|
|
56
44
|
}
|
|
57
45
|
/**
|
|
58
|
-
* Decide whether an entry answers under a locale,
|
|
46
|
+
* Decide whether an entry answers under a locale, delegating to `@mailwoman/variant-aliases`'
|
|
47
|
+
* {@linkcode resolveLocaleScope} — the owner of these semantics.
|
|
59
48
|
*
|
|
60
49
|
* A scoped entry does not match when the locale is unknown. That is the containment: a phrasing declared regional
|
|
61
50
|
* cannot be reached without knowing the region, or the record means something different from what it says.
|
|
62
51
|
*/
|
|
63
52
|
export function resolveActivityPhraseLocale(entry, locale) {
|
|
64
|
-
|
|
65
|
-
return { scope: "unscoped", confidence: 1 };
|
|
66
|
-
if (!locale)
|
|
67
|
-
return null;
|
|
68
|
-
if (entry.locales.includes(locale))
|
|
69
|
-
return { scope: "exact", confidence: 1 };
|
|
70
|
-
const language = locale.split(/[-_]/)[0];
|
|
71
|
-
if (entry.locales.some((tag) => tag.split(/[-_]/)[0] === language))
|
|
72
|
-
return { scope: "language", confidence: 0.5 };
|
|
73
|
-
return null;
|
|
53
|
+
return resolveLocaleScope(entry.locales, locale);
|
|
74
54
|
}
|
|
75
55
|
/**
|
|
76
56
|
* Everything wrong with a lexicon that can be established without leaving this package, one message per problem.
|
|
@@ -170,13 +150,10 @@ let committed;
|
|
|
170
150
|
*
|
|
171
151
|
* The committed read is memoized; an explicit path is read fresh, which is what a test asserting a refusal needs.
|
|
172
152
|
*/
|
|
173
|
-
export function readActivityLexicon(path = ACTIVITY_LEXICON_PATH) {
|
|
153
|
+
export async function readActivityLexicon(path = ACTIVITY_LEXICON_PATH) {
|
|
174
154
|
if (path === ACTIVITY_LEXICON_PATH && committed)
|
|
175
155
|
return committed;
|
|
176
|
-
|
|
177
|
-
// `@mailwoman/core`'s parse wrappers are deliberately out of reach.
|
|
178
|
-
// oxlint-disable-next-line no-restricted-properties -- zero-dependency leaf; corrupt shipped data must throw with its offset
|
|
179
|
-
const lexicon = JSON.parse(readFileSync(path, "utf8"));
|
|
156
|
+
const lexicon = await readLocalJSONFile(path);
|
|
180
157
|
const problems = auditActivityLexicon(lexicon);
|
|
181
158
|
if (problems.length) {
|
|
182
159
|
throw new Error([`activity-lexicon: ${path} does not audit:`].concat(problems.map((problem) => ` - ${problem}`)).join("\n"));
|
package/out/lexicon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicon.js","sourceRoot":"","sources":["../lexicon.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lexicon.js","sourceRoot":"","sources":["../lib/lexicon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAS/D,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAA;AAErC;;GAEG;AACH,MAAM,WAAW,GAA4C,CAAC,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,CAAC,CAAA;AAEtH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAW,MAAM,uBAAuB,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAA;AAE9G;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACrD,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAA;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAC1C,KAA0B,EAC1B,MAA0B;IAE1B,OAAO,kBAAkB,CA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,UAAU,KAAK,wBAAwB,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,4BAA4B,CACzG,CAAA;gBACF,CAAC;gBAED,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC;oBACpF,QAAQ,CAAC,IAAI,CACZ,UAAU,KAAK,iIAAiI,CAChJ,CAAA;gBACF,CAAC;YACF,CAAC;YAED,OAAO,QAAQ,CAAA;QAChB,CAAC;IACF,CAAC;AACF,CAAC;AAED,IAAI,SAA4C,CAAA;AAEhD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAe,qBAAqB;IAC7E,IAAI,IAAI,KAAK,qBAAqB,IAAI,SAAS;QAAE,OAAO,SAAS,CAAA;IAEjE,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAwB,IAAI,CAAC,CAAA;IACpE,MAAM,QAAQ,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAA;IAE9C,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACd,CAAC,qBAAqB,IAAI,kBAAkB,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC5G,CAAA;IACF,CAAC;IAED,IAAI,IAAI,KAAK,qBAAqB,EAAE,CAAC;QACpC,SAAS,GAAG,OAAO,CAAA;IACpB,CAAC;IAED,OAAO,OAAO,CAAA;AACf,CAAC"}
|
package/out/types.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
/**
|
|
19
19
|
* Where a record came from. Field-for-field the shape `@mailwoman/geographic-model` uses for its own provenance, so a
|
|
20
20
|
* consumer carrying both never has to translate between two spellings of the same idea. It is restated rather than
|
|
21
|
-
* imported because this package
|
|
21
|
+
* imported because this package does not depend on `@mailwoman/geographic-model`.
|
|
22
22
|
*/
|
|
23
23
|
export interface ActivityLexiconProvenance {
|
|
24
24
|
/**
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACzC,IAAI,EAAE,iBAAiB,CAAA;IACvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,gBAAgB,GAAG,aAAa,GAAG,YAAY,CAAA;AAEjG;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACtC,IAAI,EAAE,cAAc,CAAA;IACpB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,wBAAwB,CAAA;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC3C,IAAI,EAAE,mBAAmB,CAAA;IACzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,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ACtC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,yBAAyB,CAAA;IACrC,OAAO,EAAE,mBAAmB,EAAE,CAAA;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,yBAAyB,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CAAA;AAEzE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,KAAK,EAAE,yBAAyB,CAAA;IAChC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;CAClB"}
|
package/out/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/activity-lexicon",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.3.0",
|
|
4
4
|
"description": "Reviewed surface forms for activity concepts — the phrases a person types for what they want to do, each carrying the record that attests it and the locales it is used in.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"activity",
|
|
@@ -33,18 +33,29 @@
|
|
|
33
33
|
"!test/**"
|
|
34
34
|
],
|
|
35
35
|
"type": "module",
|
|
36
|
+
"sideEffects": false,
|
|
37
|
+
"imports": {
|
|
38
|
+
"#*": {
|
|
39
|
+
"types": "./out/*.d.ts",
|
|
40
|
+
"node": "./out/*.js",
|
|
41
|
+
"default": "./out/*.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
36
44
|
"exports": {
|
|
37
45
|
"./package.json": "./package.json",
|
|
38
46
|
".": {
|
|
39
47
|
"types": "./out/index.d.ts",
|
|
48
|
+
"node": "./out/index.js",
|
|
40
49
|
"default": "./out/index.js"
|
|
41
50
|
},
|
|
42
51
|
"./lexicon": {
|
|
43
52
|
"types": "./out/lexicon.d.ts",
|
|
53
|
+
"node": "./out/lexicon.js",
|
|
44
54
|
"default": "./out/lexicon.js"
|
|
45
55
|
},
|
|
46
56
|
"./types": {
|
|
47
57
|
"types": "./out/types.d.ts",
|
|
58
|
+
"node": "./out/types.js",
|
|
48
59
|
"default": "./out/types.js"
|
|
49
60
|
}
|
|
50
61
|
},
|
|
@@ -54,18 +65,35 @@
|
|
|
54
65
|
"./package.json": "./package.json",
|
|
55
66
|
".": {
|
|
56
67
|
"types": "./out/index.d.ts",
|
|
68
|
+
"node": "./out/index.js",
|
|
57
69
|
"default": "./out/index.js"
|
|
58
70
|
},
|
|
59
71
|
"./lexicon": {
|
|
60
72
|
"types": "./out/lexicon.d.ts",
|
|
73
|
+
"node": "./out/lexicon.js",
|
|
61
74
|
"default": "./out/lexicon.js"
|
|
62
75
|
},
|
|
63
76
|
"./types": {
|
|
64
77
|
"types": "./out/types.d.ts",
|
|
78
|
+
"node": "./out/types.js",
|
|
65
79
|
"default": "./out/types.js"
|
|
66
80
|
}
|
|
81
|
+
},
|
|
82
|
+
"imports": {
|
|
83
|
+
"#*": {
|
|
84
|
+
"types": "./out/*.d.ts",
|
|
85
|
+
"node": "./out/*.js",
|
|
86
|
+
"default": "./out/*.js"
|
|
87
|
+
}
|
|
67
88
|
}
|
|
68
89
|
},
|
|
90
|
+
"dependencies": {
|
|
91
|
+
"@mailwoman/core": "9.3.0",
|
|
92
|
+
"@mailwoman/variant-aliases": "9.3.0"
|
|
93
|
+
},
|
|
94
|
+
"devDependencies": {
|
|
95
|
+
"path-ts": "^2.3.0"
|
|
96
|
+
},
|
|
69
97
|
"engines": {
|
|
70
98
|
"node": ">=24.18.0"
|
|
71
99
|
}
|