@rangefoundry/catalog 0.0.0 → 0.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/LICENSE +27 -0
- package/LICENSE-AGPL +661 -0
- package/README.md +21 -1
- package/dist/bundle.json +1 -0
- package/dist/caliber-classes.d.ts +5 -0
- package/dist/caliber-classes.js +44 -0
- package/dist/catalogue.d.ts +237 -0
- package/dist/catalogue.js +2 -0
- package/dist/coverage.d.ts +12 -0
- package/dist/coverage.js +86 -0
- package/dist/data-set-rule.d.ts +12 -0
- package/dist/data-set-rule.js +37 -0
- package/dist/data-set.d.ts +12 -0
- package/dist/data-set.js +26 -0
- package/dist/event-types.d.ts +3 -0
- package/dist/event-types.js +49 -0
- package/dist/federations.d.ts +13 -0
- package/dist/federations.js +96 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +11 -0
- package/dist/json-object.d.ts +2 -0
- package/dist/json-object.js +3 -0
- package/dist/load-tables.d.ts +12 -0
- package/dist/load-tables.js +73 -0
- package/dist/maker-rows.d.ts +37 -0
- package/dist/maker-rows.js +201 -0
- package/dist/names.d.ts +10 -0
- package/dist/names.js +121 -0
- package/dist/plausibility.d.ts +47 -0
- package/dist/plausibility.js +399 -0
- package/dist/published-loads.d.ts +44 -0
- package/dist/published-loads.js +294 -0
- package/dist/records.d.ts +40 -0
- package/dist/records.js +160 -0
- package/dist/references.d.ts +30 -0
- package/dist/references.js +163 -0
- package/dist/sources.d.ts +24 -0
- package/dist/sources.js +130 -0
- package/package.json +61 -4
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { isEstimatedCapacity, parseRef } from '@rangefoundry/schema';
|
|
2
|
+
/** The ids of the referenced kinds in `bundle`. */
|
|
3
|
+
export function recordIds(bundle) {
|
|
4
|
+
return {
|
|
5
|
+
cartridges: new Set(bundle.cartridges.map((c) => c.id)),
|
|
6
|
+
cases: new Set(bundle.cases.map((c) => c.id)),
|
|
7
|
+
loads: new Set(bundle.loads.map((l) => l.id)),
|
|
8
|
+
manufacturers: new Set(bundle.manufacturers.map((m) => m.id)),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** The cartridge of every case, capacity, load and firing series, and the cartridges a powder is listed for. */
|
|
12
|
+
export function checkCartridgeReferences(bundle, ids, errors) {
|
|
13
|
+
const unknown = (dir, id, cartridge, found) => {
|
|
14
|
+
if (!ids.cartridges.has(found ?? cartridge))
|
|
15
|
+
errors.push(`${dir}/${id}.json: unknown cartridge "${cartridge}"`);
|
|
16
|
+
};
|
|
17
|
+
for (const r of bundle.firings)
|
|
18
|
+
unknown('firings', r.id, r.cartridge, undefined);
|
|
19
|
+
// a case, a capacity and a load name their cartridge by reference
|
|
20
|
+
for (const c of bundle.cases)
|
|
21
|
+
unknown('cases', c.id, c.cartridge, parseRef(c.cartridge)?.id);
|
|
22
|
+
for (const c of bundle.capacities)
|
|
23
|
+
unknown('capacities', c.id, c.cartridge, parseRef(c.cartridge)?.id);
|
|
24
|
+
for (const l of bundle.loads)
|
|
25
|
+
unknown('loads', l.id, l.cartridge, parseRef(l.cartridge)?.id);
|
|
26
|
+
checkListedCartridges(bundle.powders, ids, errors);
|
|
27
|
+
}
|
|
28
|
+
/** The cartridges a powder is listed for. */
|
|
29
|
+
function checkListedCartridges(powders, ids, errors) {
|
|
30
|
+
for (const p of powders)
|
|
31
|
+
for (const c of p.listedCartridges ?? [])
|
|
32
|
+
if (!ids.cartridges.has(c))
|
|
33
|
+
errors.push(`powders/${p.id}.json: unknown listed cartridge "${c}"`);
|
|
34
|
+
}
|
|
35
|
+
/** The bullet and powder of every load that names a record. */
|
|
36
|
+
export function checkLoadComponentReferences(bundle, errors) {
|
|
37
|
+
const known = {
|
|
38
|
+
bullet: new Set(bundle.bullets.map((b) => b.id)),
|
|
39
|
+
powder: new Set(bundle.powders.map((p) => p.id)),
|
|
40
|
+
};
|
|
41
|
+
for (const l of bundle.loads)
|
|
42
|
+
for (const k of ['bullet', 'powder']) {
|
|
43
|
+
const target = l[k];
|
|
44
|
+
if (typeof target === 'string' && !known[k].has(parseRef(target)?.id ?? target))
|
|
45
|
+
errors.push(`loads/${l.id}.json: unknown ${k} "${target}"`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** The primer of every load that names one. */
|
|
49
|
+
export function checkLoadPrimerReferences(bundle, errors) {
|
|
50
|
+
const known = new Set(bundle.primers.map((p) => p.id));
|
|
51
|
+
for (const l of bundle.loads) {
|
|
52
|
+
const record = l.primer?.record;
|
|
53
|
+
if (record !== undefined && !known.has(parseRef(record)?.id ?? record))
|
|
54
|
+
errors.push(`loads/${l.id}.json: unknown primer "${record}"`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** The capacity of every load that names one. */
|
|
58
|
+
export function checkLoadCapacityReferences(bundle, errors) {
|
|
59
|
+
const known = new Set(bundle.capacities.map((c) => c.id));
|
|
60
|
+
for (const l of bundle.loads)
|
|
61
|
+
if (l.capacity !== undefined && !known.has(parseRef(l.capacity)?.id ?? l.capacity))
|
|
62
|
+
errors.push(`loads/${l.id}.json: unknown capacity "${l.capacity}"`);
|
|
63
|
+
}
|
|
64
|
+
/** The default capacity of every cartridge is a published or measured capacity of it; from a single root, a cartridge with a capacity that is no estimate names one. */
|
|
65
|
+
export function checkDefaultCapacityReferences(bundle, singleRoot, errors) {
|
|
66
|
+
const known = new Map(bundle.capacities.map((c) => [c.id, c]));
|
|
67
|
+
// what defaultCapacity gives without a pointer, so a computed or fitted one cannot become the default unchecked
|
|
68
|
+
const figures = bundle.capacities.filter((c) => !isEstimatedCapacity(c));
|
|
69
|
+
const withCapacity = new Set(figures.map((c) => parseRef(c.cartridge)?.id ?? c.cartridge));
|
|
70
|
+
for (const c of bundle.cartridges) {
|
|
71
|
+
const named = c.defaults?.capacity;
|
|
72
|
+
if (named !== undefined)
|
|
73
|
+
checkNamedDefault(c.id, named, known, errors);
|
|
74
|
+
else if (singleRoot && withCapacity.has(c.id))
|
|
75
|
+
errors.push(`cartridges/${c.id}.json: has a capacity that is no estimate and names no default capacity`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/** Whether a capacity can be a default: published or measured, so never an estimate. */
|
|
79
|
+
const canBeDefault = ({ provenance }) => provenance?.kind === 'published' || provenance?.kind === 'measured';
|
|
80
|
+
/** The default capacity `named` of one cartridge, among the `known` capacities. */
|
|
81
|
+
function checkNamedDefault(cartridge, named, known, errors) {
|
|
82
|
+
const where = `cartridges/${cartridge}.json`;
|
|
83
|
+
const capacity = known.get(parseRef(named)?.id ?? named);
|
|
84
|
+
if (!capacity)
|
|
85
|
+
errors.push(`${where}: unknown default capacity "${named}"`);
|
|
86
|
+
else if (parseRef(capacity.cartridge)?.id !== cartridge)
|
|
87
|
+
errors.push(`${where}: default capacity "${named}" is a capacity of another cartridge`);
|
|
88
|
+
else if (!canBeDefault(capacity))
|
|
89
|
+
errors.push(`${where}: default capacity "${named}" is neither published nor measured`);
|
|
90
|
+
}
|
|
91
|
+
/** The case record of every load that names one: it exists and is a case of the load's cartridge. */
|
|
92
|
+
export function checkLoadCaseReferences(bundle, ids, errors) {
|
|
93
|
+
const cartridgeOfCase = new Map(bundle.cases.map((c) => [c.id, parseRef(c.cartridge)?.id ?? c.cartridge]));
|
|
94
|
+
for (const l of bundle.loads) {
|
|
95
|
+
const record = l.case?.record;
|
|
96
|
+
if (record === undefined)
|
|
97
|
+
continue;
|
|
98
|
+
const id = parseRef(record)?.id ?? record;
|
|
99
|
+
if (!ids.cases.has(id))
|
|
100
|
+
errors.push(`loads/${l.id}.json: unknown case "${record}"`);
|
|
101
|
+
else if (cartridgeOfCase.get(id) !== (parseRef(l.cartridge)?.id ?? l.cartridge))
|
|
102
|
+
errors.push(`loads/${l.id}.json: case "${record}" is a case of another cartridge`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** The session of every load that names one. */
|
|
106
|
+
export function checkLoadSessionReferences(bundle, errors) {
|
|
107
|
+
const known = new Set(bundle.chronoSessions.map((s) => s.id));
|
|
108
|
+
for (const l of bundle.loads)
|
|
109
|
+
for (const ref of l.sessions ?? [])
|
|
110
|
+
if (!known.has(parseRef(ref)?.id ?? ref))
|
|
111
|
+
errors.push(`loads/${l.id}.json: unknown session "${ref}"`);
|
|
112
|
+
}
|
|
113
|
+
/** The load of every shot string of a chronograph session. */
|
|
114
|
+
export function checkLoadReferences(bundle, ids, errors) {
|
|
115
|
+
for (const session of bundle.chronoSessions) {
|
|
116
|
+
for (const string of session.strings) {
|
|
117
|
+
if (!ids.loads.has(parseRef(string.load)?.id ?? string.load)) {
|
|
118
|
+
errors.push(`chrono/${session.id}.json: unknown load "${string.load}"`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** The manufacturers a load names: a described bullet or powder and the case. */
|
|
124
|
+
function checkLoadMakers(l, check) {
|
|
125
|
+
const named = [
|
|
126
|
+
['bullet.manufacturer', typeof l.bullet === 'object' ? l.bullet.manufacturer : undefined],
|
|
127
|
+
['powder.manufacturer', typeof l.powder === 'object' ? l.powder.manufacturer : undefined],
|
|
128
|
+
['case.manufacturer', l.case?.manufacturer],
|
|
129
|
+
];
|
|
130
|
+
for (const [field, maker] of named)
|
|
131
|
+
check(`loads/${l.id}.json`, field, maker && parseRef(maker)?.id);
|
|
132
|
+
}
|
|
133
|
+
/** The manufacturer of every powder, primer, bullet and case, and the case manufacturer of a capacity. */
|
|
134
|
+
function checkComponentMakers(bundle, check) {
|
|
135
|
+
for (const p of bundle.powders)
|
|
136
|
+
check(`powders/${p.id}.json`, 'manufacturer', p.manufacturer);
|
|
137
|
+
for (const p of bundle.primers)
|
|
138
|
+
check(`primers/${p.id}.json`, 'manufacturer', p.manufacturer);
|
|
139
|
+
for (const b of bundle.bullets)
|
|
140
|
+
check(`bullets/${b.id}.json`, 'manufacturer', b.manufacturer);
|
|
141
|
+
for (const c of bundle.cases)
|
|
142
|
+
check(`cases/${c.id}.json`, 'manufacturer', parseRef(c.manufacturer)?.id);
|
|
143
|
+
for (const c of bundle.capacities)
|
|
144
|
+
check(`capacities/${c.id}.json`, 'caseManufacturer', c.caseManufacturer && (parseRef(c.caseManufacturer)?.id ?? c.caseManufacturer));
|
|
145
|
+
}
|
|
146
|
+
/** Of every powder (and of its burn-rate charts), primer, bullet, case and listed load table, the case manufacturer of a capacity, the device manufacturer of a chronograph session and the manufacturers a load names (a described bullet or powder and the case). */
|
|
147
|
+
export function checkManufacturerReferences(bundle, loadTables, ids, errors) {
|
|
148
|
+
const check = (where, field, id) => {
|
|
149
|
+
if (id !== undefined && !ids.manufacturers.has(id))
|
|
150
|
+
errors.push(`${where}: unknown ${field} "${id}"`);
|
|
151
|
+
};
|
|
152
|
+
checkComponentMakers(bundle, check);
|
|
153
|
+
for (const p of bundle.powders)
|
|
154
|
+
for (const c of p.burnRateCharts ?? [])
|
|
155
|
+
check(`powders/${p.id}.json`, 'burn-rate chart manufacturer', c.chart.manufacturer);
|
|
156
|
+
for (const s of bundle.chronoSessions)
|
|
157
|
+
check(`chrono/${s.id}.json`, 'device.manufacturer', parseRef(s.device.manufacturer)?.id);
|
|
158
|
+
for (const l of bundle.loads)
|
|
159
|
+
checkLoadMakers(l, check);
|
|
160
|
+
for (const [file, table] of Object.entries(loadTables ?? {}))
|
|
161
|
+
check(`load-tables.json: ${file}`, 'manufacturer', table.manufacturer);
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SourceRecord } from '@rangefoundry/schema';
|
|
2
|
+
/**
|
|
3
|
+
* The source records by id, the ids records cite, the files that embed each other source, and by
|
|
4
|
+
* file the source record id of each provenance source, undefined for an embedded one.
|
|
5
|
+
*/
|
|
6
|
+
export type SourceIndex = {
|
|
7
|
+
byId: Map<string, SourceRecord>;
|
|
8
|
+
cited: Set<string>;
|
|
9
|
+
embedded: Map<string, Set<string>>;
|
|
10
|
+
citations: Map<string, (string | undefined)[]>;
|
|
11
|
+
};
|
|
12
|
+
/** An index of `records` with nothing cited yet. */
|
|
13
|
+
export declare function sourceIndex(records: SourceRecord[]): SourceIndex;
|
|
14
|
+
/**
|
|
15
|
+
* The record `json` of `file` with each source reference of its provenance resolved, each rule
|
|
16
|
+
* book of a federation (a source record id) resolved to title, edition, URL and SHA-256, and the
|
|
17
|
+
* rule book of an event type to title, edition, publisher, URL and SHA-256.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveRecord(json: unknown, index: SourceIndex, file: string, errors: string[]): unknown;
|
|
20
|
+
/**
|
|
21
|
+
* Each source is stored one way: a source record that some record cites, with a SHA-256 no other
|
|
22
|
+
* source record has, or embedded in one record only and not also a source record.
|
|
23
|
+
*/
|
|
24
|
+
export declare function checkSources(index: SourceIndex, errors: string[]): void;
|
package/dist/sources.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { sourceReference } from '@rangefoundry/schema';
|
|
2
|
+
import { isObject } from './json-object.js';
|
|
3
|
+
/** An index of `records` with nothing cited yet. */
|
|
4
|
+
export function sourceIndex(records) {
|
|
5
|
+
return {
|
|
6
|
+
byId: new Map(records.map((s) => [s.id, s])),
|
|
7
|
+
cited: new Set(),
|
|
8
|
+
embedded: new Map(),
|
|
9
|
+
citations: new Map(),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** The source record `id`, marked cited, or undefined with an error. */
|
|
13
|
+
function cite(id, index, where, errors) {
|
|
14
|
+
const record = index.byId.get(id);
|
|
15
|
+
if (!record)
|
|
16
|
+
errors.push(`${where}: unknown source "${id}"`);
|
|
17
|
+
else
|
|
18
|
+
index.cited.add(id);
|
|
19
|
+
return record;
|
|
20
|
+
}
|
|
21
|
+
/** The key of an embedded source: its SHA-256, else its title and URL as printed. */
|
|
22
|
+
function embeddedKey({ sha256, title, url }) {
|
|
23
|
+
if (typeof sha256 === 'string')
|
|
24
|
+
return sha256;
|
|
25
|
+
// oxlint-disable-next-line typescript/no-base-to-string -- the key of a malformed URL as before; the schema reports the URL
|
|
26
|
+
return `${String(title)} ${url === undefined || url === null ? '' : String(url)}`;
|
|
27
|
+
}
|
|
28
|
+
/** A reference resolved to the source record with this record's parts, or an embedded source noted. */
|
|
29
|
+
function resolveSource(entry, at, { index, file, errors }) {
|
|
30
|
+
if (!isObject(entry))
|
|
31
|
+
return entry;
|
|
32
|
+
if (!('source' in entry)) {
|
|
33
|
+
const key = embeddedKey(entry);
|
|
34
|
+
index.embedded.set(key, (index.embedded.get(key) ?? new Set()).add(file));
|
|
35
|
+
return entry;
|
|
36
|
+
}
|
|
37
|
+
const parsed = sourceReference.safeParse(entry);
|
|
38
|
+
if (!parsed.success) {
|
|
39
|
+
for (const issue of parsed.error.issues) {
|
|
40
|
+
errors.push(`${file}: ${at}${issue.path.length ? `.${issue.path.join('.')}` : ''}: ${issue.message}`);
|
|
41
|
+
}
|
|
42
|
+
return entry;
|
|
43
|
+
}
|
|
44
|
+
const { source: id, note, ...own } = parsed.data;
|
|
45
|
+
const record = cite(id, index, `${file}: ${at}`, errors);
|
|
46
|
+
if (!record)
|
|
47
|
+
return entry;
|
|
48
|
+
const { id: _id, note: shared, ...rest } = record;
|
|
49
|
+
const notes = [note, shared].filter(Boolean).join(' ');
|
|
50
|
+
return { ...rest, ...own, ...(notes && { note: notes }) };
|
|
51
|
+
}
|
|
52
|
+
/** The title, edition, URL and SHA-256 of a source record that is a rule book. */
|
|
53
|
+
const ruleBookOf = ({ title, edition, url, sha256 }) => ({
|
|
54
|
+
title,
|
|
55
|
+
edition,
|
|
56
|
+
url,
|
|
57
|
+
sha256,
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* The record `json` of `file` with each source reference of its provenance resolved, each rule
|
|
61
|
+
* book of a federation (a source record id) resolved to title, edition, URL and SHA-256, and the
|
|
62
|
+
* rule book of an event type to title, edition, publisher, URL and SHA-256.
|
|
63
|
+
*/
|
|
64
|
+
export function resolveRecord(json, index, file, errors) {
|
|
65
|
+
if (!isObject(json))
|
|
66
|
+
return json;
|
|
67
|
+
const out = { ...json };
|
|
68
|
+
const provenance = json['provenance'];
|
|
69
|
+
if (isObject(provenance) && Array.isArray(provenance['sources'])) {
|
|
70
|
+
index.citations.set(file, provenance['sources'].map((s) => isObject(s) && typeof s['source'] === 'string' ? s['source'] : undefined));
|
|
71
|
+
out['provenance'] = {
|
|
72
|
+
...provenance,
|
|
73
|
+
sources: provenance['sources'].map((s, i) => resolveSource(s, `provenance.sources.${i}`, { index, file, errors })),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
if (Array.isArray(json['ruleBooks'])) {
|
|
77
|
+
out['ruleBooks'] = json['ruleBooks'].map((id, i) => {
|
|
78
|
+
const at = `${file}: ruleBooks.${i}`;
|
|
79
|
+
if (typeof id !== 'string') {
|
|
80
|
+
errors.push(`${at}: name a source record by id`);
|
|
81
|
+
return id;
|
|
82
|
+
}
|
|
83
|
+
const record = cite(id, index, at, errors);
|
|
84
|
+
return record && ruleBookOf(record);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (typeof json['ruleBook'] === 'string') {
|
|
88
|
+
const at = `${file}: ruleBook`;
|
|
89
|
+
const record = cite(json['ruleBook'], index, at, errors);
|
|
90
|
+
if (record && !record.publisher)
|
|
91
|
+
errors.push(`${at}: source "${record.id}" names no publisher`);
|
|
92
|
+
out['ruleBook'] = record && { ...ruleBookOf(record), publisher: record.publisher };
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
/** Each source record is cited and has a SHA-256 no other one has; returns them by SHA-256. */
|
|
97
|
+
function checkSourceRecords(index, errors) {
|
|
98
|
+
const bySha = new Map();
|
|
99
|
+
for (const s of index.byId.values()) {
|
|
100
|
+
const where = `sources/${s.id}.json`;
|
|
101
|
+
if (!index.cited.has(s.id))
|
|
102
|
+
errors.push(`${where}: no record cites it`);
|
|
103
|
+
if (!s.sha256)
|
|
104
|
+
continue;
|
|
105
|
+
const other = bySha.get(s.sha256);
|
|
106
|
+
if (other)
|
|
107
|
+
errors.push(`${where}: same sha256 as sources/${other}.json`);
|
|
108
|
+
else
|
|
109
|
+
bySha.set(s.sha256, s.id);
|
|
110
|
+
}
|
|
111
|
+
return bySha;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Each source is stored one way: a source record that some record cites, with a SHA-256 no other
|
|
115
|
+
* source record has, or embedded in one record only and not also a source record.
|
|
116
|
+
*/
|
|
117
|
+
export function checkSources(index, errors) {
|
|
118
|
+
const bySha = checkSourceRecords(index, errors);
|
|
119
|
+
for (const [key, files] of index.embedded) {
|
|
120
|
+
const record = bySha.get(key);
|
|
121
|
+
const [first, ...others] = [...files];
|
|
122
|
+
if (record)
|
|
123
|
+
for (const file of files)
|
|
124
|
+
errors.push(`${file}: cite source record "${record}" by id`);
|
|
125
|
+
else if (others.length) {
|
|
126
|
+
errors.push(`${first}: source also in ${others.join(', ')}, make it a source record`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=sources.js.map
|
package/package.json
CHANGED
|
@@ -1,11 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rangefoundry/catalog",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "RangeFoundry catalogue records as one JSON bundle and the checks they pass.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"reloading",
|
|
7
|
+
"ballistics",
|
|
8
|
+
"cartridge",
|
|
9
|
+
"bullet",
|
|
10
|
+
"powder"
|
|
11
|
+
],
|
|
12
|
+
"license": "AGPL-3.0-or-later AND CC-BY-SA-4.0",
|
|
13
|
+
"homepage": "https://rangefoundry.github.io/workbench/docs/libraries/catalog/",
|
|
5
14
|
"repository": {
|
|
6
15
|
"type": "git",
|
|
7
16
|
"url": "git+https://github.com/RangeFoundry/workbench.git",
|
|
8
17
|
"directory": "packages/catalog"
|
|
9
18
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=22"
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"main": "dist/index.js",
|
|
28
|
+
"types": "dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./plausibility": {
|
|
35
|
+
"types": "./dist/plausibility.d.ts",
|
|
36
|
+
"default": "./dist/plausibility.js"
|
|
37
|
+
},
|
|
38
|
+
"./bundle.json": "./dist/bundle.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"!dist/**/*.map",
|
|
43
|
+
"!dist/*.tsbuildinfo",
|
|
44
|
+
"!dist/api-extractor",
|
|
45
|
+
"LICENSE",
|
|
46
|
+
"LICENSE-AGPL"
|
|
47
|
+
],
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@rangefoundry/schema": "0.1.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@arethetypeswrong/cli": "0.18.5",
|
|
53
|
+
"@microsoft/api-extractor": "7.60.1",
|
|
54
|
+
"@types/node": "26.6.6",
|
|
55
|
+
"@vitest/coverage-v8": "5.1.1",
|
|
56
|
+
"oxlint": "1.94.0",
|
|
57
|
+
"oxlint-tsgolint": "7.0.2008",
|
|
58
|
+
"publint": "0.3.25",
|
|
59
|
+
"typescript": "7.0.2",
|
|
60
|
+
"vitest": "5.1.1"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsc -b tsconfig.build.json && api-extractor run && node ../../tools/src/catalog/build.ts",
|
|
64
|
+
"typecheck": "tsc --noEmit && tsc -p test",
|
|
65
|
+
"lint": "oxlint --type-aware --deny-warnings --report-unused-disable-directives",
|
|
66
|
+
"test": "vitest run --coverage && publint --strict && attw --pack . --profile esm-only"
|
|
67
|
+
}
|
|
68
|
+
}
|