plumb-fhir 0.6.0 → 0.6.2
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/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/dist/cjs/commands.d.ts.map +1 -1
- package/dist/cjs/conformance.d.ts +4 -1
- package/dist/cjs/conformance.d.ts.map +1 -1
- package/dist/cjs/emit/print.d.ts.map +1 -1
- package/dist/cjs/emit/transform.d.ts.map +1 -1
- package/dist/esm/cli.mjs +95 -48
- package/dist/esm/cli.mjs.map +3 -3
- package/dist/esm/commands.d.ts.map +1 -1
- package/dist/esm/conformance.d.ts +4 -1
- package/dist/esm/conformance.d.ts.map +1 -1
- package/dist/esm/emit/print.d.ts.map +1 -1
- package/dist/esm/emit/transform.d.ts.map +1 -1
- package/package.json +12 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.2 (2026-10-05)
|
|
4
|
+
|
|
5
|
+
`validate` and `push` from an installed Plumb, and on Medplum's `awslambda`
|
|
6
|
+
bot runtime, where the checker now has its first verified run.
|
|
7
|
+
|
|
8
|
+
- **The installed CLI finds its own package.** It stopped at
|
|
9
|
+
`dist/esm/package.json`, so `validate` and `push` failed reading
|
|
10
|
+
`dist/esm/dist/checker.cjs`, and `--version` printed `undefined` (#117,
|
|
11
|
+
#118). `./package.json` is exported.
|
|
12
|
+
- **On the `awslambda` runtime, a page waits while the checker's function is
|
|
13
|
+
not ready** (`Pending` after an install, an update in progress after a
|
|
14
|
+
redeploy), for up to a minute, instead of failing the first gate (#119).
|
|
15
|
+
|
|
16
|
+
## 0.6.1 (2026-10-05)
|
|
17
|
+
|
|
18
|
+
Fixes from the first adoption of 0.6.0 in a Medplum monorepo. Regenerate to
|
|
19
|
+
pick them up: `plumb generate --check` reports the generated files as stale.
|
|
20
|
+
|
|
21
|
+
- **Doc comments** are no longer cut at an abbreviation or inside
|
|
22
|
+
parentheses: US Core's `telecom` read `A contact detail (e.g.` (#111).
|
|
23
|
+
- **The generated reads compile without the DOM lib or `@types/node`.**
|
|
24
|
+
`searchProfiled` takes a string, a record, or any list of pairs (a
|
|
25
|
+
`URLSearchParams` is one) and passes `searchResources` plain pairs, so
|
|
26
|
+
`ProfiledReader.searchResources` now takes `string[][]`; a `MedplumClient`
|
|
27
|
+
still fits (#112).
|
|
28
|
+
- **Generated files export only what the index or a sibling uses**, so
|
|
29
|
+
unused-export tools such as knip report nothing in them: `routes`,
|
|
30
|
+
`required` and `WithId` are no longer exported (#113).
|
|
31
|
+
- `npm pkg fix` on `bin`, and the README's cache action at v6 (#115).
|
|
32
|
+
|
|
3
33
|
## 0.6.0 (2026-10-05)
|
|
4
34
|
|
|
5
35
|
The first published release; it includes everything in 0.1.0 to 0.5.0, which were not published.
|
package/README.md
CHANGED
|
@@ -155,7 +155,7 @@ and its dependencies), so cache the shared package cache, keyed on
|
|
|
155
155
|
checks each cached package against the lock's hashes. In GitHub Actions:
|
|
156
156
|
|
|
157
157
|
```yaml
|
|
158
|
-
- uses: actions/cache@
|
|
158
|
+
- uses: actions/cache@v6
|
|
159
159
|
with:
|
|
160
160
|
path: ~/.fhir/packages
|
|
161
161
|
key: fhir-packages-${{ hashFiles('plumb.lock') }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,OAAO,EAIb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAiC,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAGzE,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,6DAA6D;IAC7D,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,CAAC,IAAI,EAAE,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
|
-
import type { Reason } from './checker/handler.js';
|
|
2
|
+
import type { PageResult, Reason } from './checker/handler.js';
|
|
3
|
+
import { checkerInput } from './checker/input.js';
|
|
3
4
|
import { type EnvOptions, type EnvResult } from './connect.js';
|
|
4
5
|
import type { LoadProfilesResult } from './loader.js';
|
|
5
6
|
type ValidateStepName = 'load' | 'connect' | 'checker' | 'profiles' | 'validate';
|
|
@@ -85,5 +86,7 @@ export declare function judge(result: Pick<Checked, 'types' | 'profiles'>, selec
|
|
|
85
86
|
summary: string;
|
|
86
87
|
failed: boolean;
|
|
87
88
|
};
|
|
89
|
+
/** One page, as an async job: a page can outlast an HTTP request, not the bot's timeout. */
|
|
90
|
+
export declare function runPage(medplum: MedplumClient, botId: string, input: ReturnType<typeof checkerInput>, wait?: (ms: number) => Promise<void>): Promise<PageResult>;
|
|
88
91
|
export {};
|
|
89
92
|
//# sourceMappingURL=conformance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../src/conformance.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../src/conformance.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAyB,MAAM,cAAc,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,KAAK,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEjF,sEAAsE;A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CAsBrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print.d.ts","sourceRoot":"","sources":["../../../src/emit/print.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAS,OAAO,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAiB,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE5E,uFAAuF;AACvF,eAAO,MAAM,MAAM,0BAA0B,CAAC;AAqG9C,wFAAwF;AACxF,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CAgD7C;AA8UD,KAAK,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"print.d.ts","sourceRoot":"","sources":["../../../src/emit/print.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAS,OAAO,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAiB,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE5E,uFAAuF;AACvF,eAAO,MAAM,MAAM,0BAA0B,CAAC;AAqG9C,wFAAwF;AACxF,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CAgD7C;AA8UD,KAAK,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;AAkR5F,kHAAkH;AAClH,wBAAgB,UAAU,CACxB,MAAM,EAAE,YAAY,EAAE,EACtB,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,MAAM,EACvC,OAAO,GAAE,YAAiF,GACzF,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAyBrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/emit/trans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0EAA0E;IAC1E,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAwFA"}
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1251,8 +1251,8 @@ function registerCore() {
|
|
|
1251
1251
|
coreIndexed = true;
|
|
1252
1252
|
}
|
|
1253
1253
|
function dependenciesOf(dir) {
|
|
1254
|
-
const
|
|
1255
|
-
return Object.entries(
|
|
1254
|
+
const manifest2 = JSON.parse(readFileSync(join2(dir, "package", "package.json"), "utf8"));
|
|
1255
|
+
return Object.entries(manifest2.dependencies ?? {}).map(([name2, version2]) => `${name2}@${version2}`);
|
|
1256
1256
|
}
|
|
1257
1257
|
var Closure = class {
|
|
1258
1258
|
definitions = /* @__PURE__ */ new Map();
|
|
@@ -1498,8 +1498,8 @@ async function resolve3(igs, lock, check2, cacheDir, fetch) {
|
|
|
1498
1498
|
const locked = lock?.packages[id]?.integrity;
|
|
1499
1499
|
if (check2 && !locked) throw new Failure("lock-disagrees", `plumb.lock does not list ${id}.`);
|
|
1500
1500
|
const { pkg, integrity } = await ensureCached(id, cacheDir, locked, fetch);
|
|
1501
|
-
const
|
|
1502
|
-
if (roots.has(id)) queue.push(...dependenciesOf2(id,
|
|
1501
|
+
const manifest2 = readManifest(id, pkg.dir);
|
|
1502
|
+
if (roots.has(id)) queue.push(...dependenciesOf2(id, manifest2));
|
|
1503
1503
|
packages.push(pkg);
|
|
1504
1504
|
integrities[id] = { integrity };
|
|
1505
1505
|
} catch (err) {
|
|
@@ -1542,16 +1542,16 @@ async function ensureCached(id, cacheDir, locked, fetch) {
|
|
|
1542
1542
|
return { pkg: { name: name2, version: version2, dir, fetched, integrity }, integrity };
|
|
1543
1543
|
}
|
|
1544
1544
|
function readManifest(id, dir) {
|
|
1545
|
-
const
|
|
1545
|
+
const manifest2 = JSON.parse(
|
|
1546
1546
|
readFileSync2(join3(dir, "package", "package.json"), "utf8")
|
|
1547
1547
|
);
|
|
1548
|
-
if (
|
|
1549
|
-
throw new Failure("not-r4", `${id} is for FHIR ${
|
|
1548
|
+
if (manifest2.fhirVersions && !manifest2.fhirVersions.some((v) => v.startsWith("4.0"))) {
|
|
1549
|
+
throw new Failure("not-r4", `${id} is for FHIR ${manifest2.fhirVersions.join(", ")}, not R4.`);
|
|
1550
1550
|
}
|
|
1551
|
-
return
|
|
1551
|
+
return manifest2;
|
|
1552
1552
|
}
|
|
1553
|
-
function dependenciesOf2(id,
|
|
1554
|
-
return Object.entries(
|
|
1553
|
+
function dependenciesOf2(id, manifest2) {
|
|
1554
|
+
return Object.entries(manifest2.dependencies ?? {}).filter(([name2]) => name2 !== BASE_R4).map(([name2, version2]) => {
|
|
1555
1555
|
if (!EXACT_VERSION.test(version2)) {
|
|
1556
1556
|
throw new Failure(
|
|
1557
1557
|
"inexact-dependency",
|
|
@@ -1570,8 +1570,8 @@ async function download(name2, version2, fetch) {
|
|
|
1570
1570
|
if (!response.ok) throw new Failure("registry-error", `${url} returned ${response.status}.`);
|
|
1571
1571
|
return response;
|
|
1572
1572
|
};
|
|
1573
|
-
const
|
|
1574
|
-
const dist =
|
|
1573
|
+
const manifest2 = await (await get(`${REGISTRY}/${name2}`)).json();
|
|
1574
|
+
const dist = manifest2.versions?.[version2]?.dist;
|
|
1575
1575
|
if (!dist?.tarball || !dist.shasum) {
|
|
1576
1576
|
throw new Failure("registry-error", `The registry has no ${id}.`);
|
|
1577
1577
|
}
|
|
@@ -1862,20 +1862,31 @@ async function checkType(medplum, saved, options, botId, input, onCore) {
|
|
|
1862
1862
|
await options.onPage?.(resourceType, saved.pages);
|
|
1863
1863
|
} while (!type.done);
|
|
1864
1864
|
}
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1865
|
+
var NOT_READY = /currently in the following state: Pending|An update is in progress for resource/;
|
|
1866
|
+
var READY_WAIT_MS = 2e3;
|
|
1867
|
+
var READY_TIMEOUT_MS = 6e4;
|
|
1868
|
+
async function runPage(medplum, botId, input, wait = (ms3) => new Promise((resolve4) => setTimeout(resolve4, ms3))) {
|
|
1869
|
+
for (let waited = 0; ; waited += READY_WAIT_MS) {
|
|
1870
|
+
const job = await medplum.post(
|
|
1871
|
+
medplum.fhirUrl("Bot", botId, "$execute"),
|
|
1872
|
+
input,
|
|
1873
|
+
ContentType.JSON,
|
|
1874
|
+
{ headers: { Prefer: "respond-async" }, pollStatusOnAccepted: true }
|
|
1875
|
+
);
|
|
1876
|
+
const output = job.output?.parameter ?? [];
|
|
1877
|
+
const body = output.find((p) => p.name === "responseBody")?.valueString;
|
|
1878
|
+
if (job.status === "completed" && body !== void 0) return JSON.parse(body);
|
|
1879
|
+
const reason = normalizeErrorString2(output.find((p) => p.resource)?.resource);
|
|
1880
|
+
if (!NOT_READY.test(reason)) {
|
|
1881
|
+
throw new Error(`The checker's job ended ${job.status}: ${reason}`);
|
|
1882
|
+
}
|
|
1883
|
+
if (waited >= READY_TIMEOUT_MS) {
|
|
1884
|
+
throw new Error(
|
|
1885
|
+
`The checker bot is still not ready after ${READY_TIMEOUT_MS / 1e3}s: ${reason}`
|
|
1886
|
+
);
|
|
1887
|
+
}
|
|
1888
|
+
await wait(READY_WAIT_MS);
|
|
1877
1889
|
}
|
|
1878
|
-
return JSON.parse(body);
|
|
1879
1890
|
}
|
|
1880
1891
|
function merge(saved, type, page) {
|
|
1881
1892
|
type.read += page.read;
|
|
@@ -2351,7 +2362,7 @@ function printRoutes(routing, typeNames) {
|
|
|
2351
2362
|
" * The content that selects each profile: a row matches a resource when, for",
|
|
2352
2363
|
" * every key, the element holds one of its patterns (`matches` in _plumb.ts).",
|
|
2353
2364
|
" */",
|
|
2354
|
-
"
|
|
2365
|
+
"const routes = {",
|
|
2355
2366
|
...Object.keys(routing.routes).sort().flatMap((type) => printRows(type, routing.routes[type] ?? [])),
|
|
2356
2367
|
"} as const;",
|
|
2357
2368
|
"",
|
|
@@ -2491,7 +2502,7 @@ export function pickProfiled<U extends ProfileUrl>(resources: readonly Resource[
|
|
|
2491
2502
|
}
|
|
2492
2503
|
|
|
2493
2504
|
/** A resource as the server returns it, with its id. The same as \`WithId\` in @medplum/core. */
|
|
2494
|
-
|
|
2505
|
+
type WithId<T> = T & { id: string };
|
|
2495
2506
|
|
|
2496
2507
|
/**
|
|
2497
2508
|
* The part of a \`MedplumClient\` the reads use, so the generated code needs no
|
|
@@ -2500,14 +2511,17 @@ export type WithId<T> = T & { id: string };
|
|
|
2500
2511
|
export interface ProfiledReader {
|
|
2501
2512
|
readResource(resourceType: ResourceType, id: string): Promise<Resource>;
|
|
2502
2513
|
readReference(reference: Reference): Promise<Resource>;
|
|
2503
|
-
searchResources(resourceType: ResourceType, query:
|
|
2514
|
+
searchResources(resourceType: ResourceType, query: string[][]): Promise<Resource[]>;
|
|
2504
2515
|
}
|
|
2505
2516
|
|
|
2506
|
-
/**
|
|
2517
|
+
/**
|
|
2518
|
+
* A search query, in any form \`medplum.searchResources\` takes: a string, a
|
|
2519
|
+
* URLSearchParams or any other list of pairs, or a record. Typed without
|
|
2520
|
+
* URLSearchParams, so the generated code compiles without the DOM lib.
|
|
2521
|
+
*/
|
|
2507
2522
|
export type ProfiledQuery =
|
|
2508
|
-
| URLSearchParams
|
|
2509
2523
|
| string
|
|
2510
|
-
| string[]
|
|
2524
|
+
| Iterable<readonly string[]>
|
|
2511
2525
|
| Record<string, string | number | boolean | readonly (string | number | boolean)[] | undefined>;
|
|
2512
2526
|
|
|
2513
2527
|
/**
|
|
@@ -2544,25 +2558,38 @@ export async function searchProfiled<U extends ProfileUrl>(
|
|
|
2544
2558
|
query: ProfiledQuery = {},
|
|
2545
2559
|
): Promise<WithId<ProfileTypes[U]>[]> {
|
|
2546
2560
|
const params = searchParams(query);
|
|
2547
|
-
for (const key of params
|
|
2548
|
-
const name = key
|
|
2561
|
+
for (const [key] of params) {
|
|
2562
|
+
const name = key?.split(':')[0] ?? '';
|
|
2549
2563
|
if (subsets.includes(name) || includes.includes(name)) throw refusal(profile, name);
|
|
2550
2564
|
}
|
|
2551
|
-
params.
|
|
2565
|
+
params.push(['_profile', (accepts[profile] ?? [profile]).join(',')]);
|
|
2552
2566
|
const found = await medplum.searchResources(typeOf[profile] as ResourceType, params);
|
|
2553
2567
|
return pickProfiled(found, profile) as WithId<ProfileTypes[U]>[];
|
|
2554
2568
|
}
|
|
2555
2569
|
|
|
2556
|
-
function searchParams(query: ProfiledQuery):
|
|
2557
|
-
if (typeof query === 'string'
|
|
2558
|
-
|
|
2559
|
-
|
|
2570
|
+
function searchParams(query: ProfiledQuery): string[][] {
|
|
2571
|
+
if (typeof query === 'string') {
|
|
2572
|
+
return query
|
|
2573
|
+
.replace(/^\\?/, '')
|
|
2574
|
+
.split('&')
|
|
2575
|
+
.filter((pair) => pair !== '')
|
|
2576
|
+
.map((pair) => {
|
|
2577
|
+
const at = pair.indexOf('=');
|
|
2578
|
+
const [key, value] = at === -1 ? [pair, ''] : [pair.slice(0, at), pair.slice(at + 1)];
|
|
2579
|
+
return [decode(key), decode(value)];
|
|
2580
|
+
});
|
|
2581
|
+
}
|
|
2582
|
+
const pairs = Symbol.iterator in query ? [...(query as Iterable<readonly string[]>)] : Object.entries(query);
|
|
2583
|
+
const params: string[][] = [];
|
|
2560
2584
|
for (const [key, value] of pairs) {
|
|
2561
|
-
for (const v of [value].flat()) if (key !== undefined && v !== undefined) params.
|
|
2585
|
+
for (const v of [value].flat()) if (key !== undefined && v !== undefined) params.push([key, String(v)]);
|
|
2562
2586
|
}
|
|
2563
2587
|
return params;
|
|
2564
2588
|
}
|
|
2565
2589
|
|
|
2590
|
+
// As URLSearchParams decodes: '+' is a space.
|
|
2591
|
+
const decode = (text: string) => decodeURIComponent(text.replace(/\\+/g, ' '));
|
|
2592
|
+
|
|
2566
2593
|
function refusal(profile: ProfileUrl, name: string): ProfileReadError {
|
|
2567
2594
|
const why = subsets.includes(name)
|
|
2568
2595
|
? \`a subset is not a \${short(profile)}. Use medplum.searchResources for a subset.\`
|
|
@@ -2597,7 +2624,7 @@ function printReads(models, routing) {
|
|
|
2597
2624
|
"required",
|
|
2598
2625
|
"Record<ProfileUrl, readonly (readonly string[])[]>",
|
|
2599
2626
|
selected.map((m) => [m.url, m.required])
|
|
2600
|
-
)
|
|
2627
|
+
),
|
|
2601
2628
|
"",
|
|
2602
2629
|
"/** The stamps a read accepts as each profile: its own URL, and each selected profile deriving from it. */",
|
|
2603
2630
|
...printTable(
|
|
@@ -2761,7 +2788,21 @@ function childrenOf(elements, key) {
|
|
|
2761
2788
|
Object.entries(elements).filter(([k]) => k.startsWith(prefix)).map(([k, e]) => [k.slice(prefix.length), e])
|
|
2762
2789
|
);
|
|
2763
2790
|
}
|
|
2764
|
-
var
|
|
2791
|
+
var ABBREVIATION = /\b(?:e\.g|i\.e|etc|vs|cf)\.$/i;
|
|
2792
|
+
function firstSentence(text) {
|
|
2793
|
+
if (text === void 0) return void 0;
|
|
2794
|
+
let depth = 0;
|
|
2795
|
+
for (let i = 0; i < text.length; i++) {
|
|
2796
|
+
const c = text[i];
|
|
2797
|
+
if (c === "(") depth++;
|
|
2798
|
+
else if (c === ")") depth = Math.max(0, depth - 1);
|
|
2799
|
+
else if (c === "." && depth === 0 && /\s/.test(text[i + 1] ?? "")) {
|
|
2800
|
+
const sentence = text.slice(0, i + 1);
|
|
2801
|
+
if (!ABBREVIATION.test(sentence)) return sentence.trim();
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
return text.trim();
|
|
2805
|
+
}
|
|
2765
2806
|
var ProfileTransform = class {
|
|
2766
2807
|
notes = [];
|
|
2767
2808
|
warnings = [];
|
|
@@ -3558,23 +3599,23 @@ function buildFsh(project, options = {}) {
|
|
|
3558
3599
|
return { ok: errors.length === 0, counts, warnings: messages.warn, errors };
|
|
3559
3600
|
}
|
|
3560
3601
|
function findSushi(project) {
|
|
3561
|
-
let
|
|
3602
|
+
let manifest2;
|
|
3562
3603
|
try {
|
|
3563
|
-
|
|
3604
|
+
manifest2 = createRequire(join6(project, "package.json")).resolve("fsh-sushi/package.json");
|
|
3564
3605
|
} catch {
|
|
3565
3606
|
return {
|
|
3566
3607
|
code: "sushi-not-installed",
|
|
3567
3608
|
message: `"fsh" needs SUSHI, and none is installed for ${project}. Run npm install --save-dev fsh-sushi.`
|
|
3568
3609
|
};
|
|
3569
3610
|
}
|
|
3570
|
-
const pkg = JSON.parse(readFileSync5(
|
|
3611
|
+
const pkg = JSON.parse(readFileSync5(manifest2, "utf8"));
|
|
3571
3612
|
if (Number.parseInt(pkg.version, 10) < OLDEST) {
|
|
3572
3613
|
return {
|
|
3573
3614
|
code: "sushi-too-old",
|
|
3574
3615
|
message: `"fsh" needs SUSHI ${OLDEST} or later; ${pkg.version} is installed. Run npm install --save-dev fsh-sushi@latest.`
|
|
3575
3616
|
};
|
|
3576
3617
|
}
|
|
3577
|
-
return { bin: join6(dirname4(
|
|
3618
|
+
return { bin: join6(dirname4(manifest2), typeof pkg.bin === "string" ? pkg.bin : pkg.bin.sushi) };
|
|
3578
3619
|
}
|
|
3579
3620
|
function parseLog(text) {
|
|
3580
3621
|
const messages = [];
|
|
@@ -4004,12 +4045,18 @@ var PROBLEMS = 1;
|
|
|
4004
4045
|
var USAGE_ERROR = 2;
|
|
4005
4046
|
function packageDir() {
|
|
4006
4047
|
let dir = dirname5(fileURLToPath(import.meta.url));
|
|
4007
|
-
while (
|
|
4048
|
+
while (manifest(dir)?.name !== "plumb-fhir") {
|
|
4049
|
+
if (dir === dirname5(dir)) throw new Error("plumb: cannot find the plumb-fhir package.json.");
|
|
4050
|
+
dir = dirname5(dir);
|
|
4051
|
+
}
|
|
4008
4052
|
return dir;
|
|
4009
4053
|
}
|
|
4054
|
+
function manifest(dir) {
|
|
4055
|
+
const file = join8(dir, "package.json");
|
|
4056
|
+
return existsSync6(file) ? JSON.parse(readFileSync6(file, "utf8")) : void 0;
|
|
4057
|
+
}
|
|
4010
4058
|
function version() {
|
|
4011
|
-
|
|
4012
|
-
return JSON.parse(readFileSync6(file, "utf8")).version;
|
|
4059
|
+
return manifest(packageDir())?.version ?? "";
|
|
4013
4060
|
}
|
|
4014
4061
|
var time = (ms3) => ms3 < 1e3 ? `${ms3}ms` : `${(ms3 / 1e3).toFixed(1)}s`;
|
|
4015
4062
|
function formatStep(step, out) {
|