babelfhir-ts 1.5.6 → 1.5.8
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 -0
- package/out/fhir-r4.d.ts +2 -4
- package/out/fhir-r4b.d.ts +3 -4
- package/out/src/cli/installCommand.js +72 -8
- package/out/src/generator/emitters/interface/interfaceFieldProcessor.js +3 -2
- package/out/src/generator/emitters/interface/processFlatField.js +29 -6
- package/out/src/main.js +8 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -237,6 +237,7 @@ Options:
|
|
|
237
237
|
--prefab-styles <path> Path to styles module (.ts/.js) copied into the generated prefab/ folder
|
|
238
238
|
--recursive (update only) Recursively search subdirectories for lib/ folders
|
|
239
239
|
--force (update only) Force regeneration even if version and flags haven't changed
|
|
240
|
+
--skip-install (install only) Generate tarball without running package manager install
|
|
240
241
|
--outDir <dir> Output directory (alias for second positional argument)
|
|
241
242
|
--fhir-version <ver> FHIR version to target: r4, r4b, or r5 (auto-detected from package if omitted)
|
|
242
243
|
--package <pkg[@version]> Download FHIR package from registry and process it (latest if no version)
|
package/out/fhir-r4.d.ts
CHANGED
|
@@ -437,6 +437,7 @@ declare module 'fhir/r4' {
|
|
|
437
437
|
export type MolecularSequenceStructureVariantOuter = fhir4.MolecularSequenceStructureVariantOuter;
|
|
438
438
|
export type MolecularSequenceVariant = fhir4.MolecularSequenceVariant;
|
|
439
439
|
export type Money = fhir4.Money;
|
|
440
|
+
export type MoneyQuantity = fhir4.MoneyQuantity;
|
|
440
441
|
export type NamingSystem = fhir4.NamingSystem;
|
|
441
442
|
export type NamingSystemUniqueId = fhir4.NamingSystemUniqueId;
|
|
442
443
|
export type Narrative = fhir4.Narrative;
|
|
@@ -540,6 +541,7 @@ declare module 'fhir/r4' {
|
|
|
540
541
|
export type SearchParameterComponent = fhir4.SearchParameterComponent;
|
|
541
542
|
export type ServiceRequest = fhir4.ServiceRequest;
|
|
542
543
|
export type Signature = fhir4.Signature;
|
|
544
|
+
export type SimpleQuantity = fhir4.SimpleQuantity;
|
|
543
545
|
export type Slot = fhir4.Slot;
|
|
544
546
|
export type Specimen = fhir4.Specimen;
|
|
545
547
|
export type SpecimenCollection = fhir4.SpecimenCollection;
|
|
@@ -673,8 +675,4 @@ declare module 'fhir/r4' {
|
|
|
673
675
|
export type VisionPrescription = fhir4.VisionPrescription;
|
|
674
676
|
export type VisionPrescriptionLensSpecification = fhir4.VisionPrescriptionLensSpecification;
|
|
675
677
|
export type VisionPrescriptionLensSpecificationPrism = fhir4.VisionPrescriptionLensSpecificationPrism;
|
|
676
|
-
/** Constraint profile on Quantity — missing from @types/fhir */
|
|
677
|
-
export type MoneyQuantity = fhir4.Quantity;
|
|
678
|
-
/** Constraint profile on Quantity — missing from @types/fhir */
|
|
679
|
-
export type SimpleQuantity = fhir4.Quantity;
|
|
680
678
|
}
|
package/out/fhir-r4b.d.ts
CHANGED
|
@@ -468,6 +468,7 @@ declare module 'fhir/r4b' {
|
|
|
468
468
|
export type MolecularSequenceStructureVariantOuter = fhir4b.MolecularSequenceStructureVariantOuter;
|
|
469
469
|
export type MolecularSequenceVariant = fhir4b.MolecularSequenceVariant;
|
|
470
470
|
export type Money = fhir4b.Money;
|
|
471
|
+
export type MoneyQuantity = fhir4b.MoneyQuantity;
|
|
471
472
|
export type NamingSystem = fhir4b.NamingSystem;
|
|
472
473
|
export type NamingSystemUniqueId = fhir4b.NamingSystemUniqueId;
|
|
473
474
|
export type Narrative = fhir4b.Narrative;
|
|
@@ -579,6 +580,7 @@ declare module 'fhir/r4b' {
|
|
|
579
580
|
export type SearchParameterComponent = fhir4b.SearchParameterComponent;
|
|
580
581
|
export type ServiceRequest = fhir4b.ServiceRequest;
|
|
581
582
|
export type Signature = fhir4b.Signature;
|
|
583
|
+
export type SimpleQuantity = fhir4b.SimpleQuantity;
|
|
582
584
|
export type Slot = fhir4b.Slot;
|
|
583
585
|
export type Specimen = fhir4b.Specimen;
|
|
584
586
|
export type SpecimenCollection = fhir4b.SpecimenCollection;
|
|
@@ -693,8 +695,5 @@ declare module 'fhir/r4b' {
|
|
|
693
695
|
export type VisionPrescription = fhir4b.VisionPrescription;
|
|
694
696
|
export type VisionPrescriptionLensSpecification = fhir4b.VisionPrescriptionLensSpecification;
|
|
695
697
|
export type VisionPrescriptionLensSpecificationPrism = fhir4b.VisionPrescriptionLensSpecificationPrism;
|
|
696
|
-
|
|
697
|
-
export type MoneyQuantity = fhir4b.Quantity;
|
|
698
|
-
/** Constraint profile on Quantity — missing from @types/fhir */
|
|
699
|
-
export type SimpleQuantity = fhir4b.Quantity;
|
|
698
|
+
|
|
700
699
|
}
|
|
@@ -52,11 +52,18 @@ export function detectPackageManager(startDir) {
|
|
|
52
52
|
* Build the install arguments for the package manager.
|
|
53
53
|
* Returns `['install']` when the dep already exists, or `[...pmArgs, relativePath]` for new deps.
|
|
54
54
|
* Always uses a relative path (e.g. `./lib/foo.tgz`) — never an absolute path.
|
|
55
|
+
*
|
|
56
|
+
* For pnpm: always writes the dep into package.json and returns `['install']`.
|
|
57
|
+
* This avoids `pnpm add` triggering full resolution that chokes on `workspace:*`
|
|
58
|
+
* protocol dependencies in monorepo setups (see issue #104).
|
|
59
|
+
*
|
|
55
60
|
* Exported for testing.
|
|
56
61
|
*/
|
|
57
62
|
export function buildInstallArgs(opts) {
|
|
58
|
-
const { packagePath, pmArgs, cwd, packageJsonContent } = opts;
|
|
63
|
+
const { packagePath, pmArgs, cwd, packageJsonContent, pmCmd, packageName } = opts;
|
|
59
64
|
const tgzRelPath = './' + path.relative(cwd, packagePath).replace(/\\/g, '/');
|
|
65
|
+
// pnpm and yarn both support workspace:* protocol which chokes `add` commands
|
|
66
|
+
const isWorkspaceAwarePm = pmCmd ? (pmCmd.includes('pnpm') || pmCmd.includes('yarn')) : false;
|
|
60
67
|
if (packageJsonContent) {
|
|
61
68
|
try {
|
|
62
69
|
const projectPkg = JSON.parse(packageJsonContent);
|
|
@@ -71,21 +78,71 @@ export function buildInstallArgs(opts) {
|
|
|
71
78
|
}
|
|
72
79
|
const tgzBaseName = path.basename(packagePath, '.tgz').replace(/^-/, '');
|
|
73
80
|
for (const name of Object.keys(deps)) {
|
|
74
|
-
if (name.replace(/[@/]/g, '-') === tgzBaseName) {
|
|
81
|
+
if (name.replace(/[@/]/g, '-').replace(/^-/, '') === tgzBaseName) {
|
|
75
82
|
deps[name] = tgzRelPath;
|
|
76
83
|
projectPkg.dependencies = deps;
|
|
84
|
+
// For workspace-aware PMs: write dep and use plain install to avoid
|
|
85
|
+
// workspace:* resolution failure
|
|
86
|
+
if (isWorkspaceAwarePm) {
|
|
87
|
+
return {
|
|
88
|
+
args: ['install'],
|
|
89
|
+
updatedPackageJson: JSON.stringify(projectPkg, null, 2) + '\n',
|
|
90
|
+
};
|
|
91
|
+
}
|
|
77
92
|
return {
|
|
78
93
|
args: [...pmArgs, tgzRelPath],
|
|
79
94
|
updatedPackageJson: JSON.stringify(projectPkg, null, 2) + '\n',
|
|
80
95
|
};
|
|
81
96
|
}
|
|
82
97
|
}
|
|
98
|
+
// For workspace-aware PMs: write the dep directly into package.json and use `install`
|
|
99
|
+
// instead of `add` to avoid full resolution that chokes on workspace:* protocol
|
|
100
|
+
if (isWorkspaceAwarePm && packageName) {
|
|
101
|
+
if (!projectPkg.dependencies)
|
|
102
|
+
projectPkg.dependencies = {};
|
|
103
|
+
projectPkg.dependencies[packageName] = tgzRelPath;
|
|
104
|
+
return {
|
|
105
|
+
args: ['install'],
|
|
106
|
+
updatedPackageJson: JSON.stringify(projectPkg, null, 2) + '\n',
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
// For workspace-aware PMs without packageName: still prefer plain install
|
|
110
|
+
// over add to avoid workspace:* resolution failure. The tgz won't be in
|
|
111
|
+
// package.json but at least the command won't crash.
|
|
112
|
+
if (isWorkspaceAwarePm) {
|
|
113
|
+
return { args: ['install'] };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
// JSON parse failed (empty string, malformed content, etc.)
|
|
118
|
+
// For workspace-aware PMs: fall through to safe install path below
|
|
119
|
+
if (isWorkspaceAwarePm && packageName) {
|
|
120
|
+
const newPkg = { dependencies: { [packageName]: tgzRelPath } };
|
|
121
|
+
return {
|
|
122
|
+
args: ['install'],
|
|
123
|
+
updatedPackageJson: JSON.stringify(newPkg, null, 2) + '\n',
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (isWorkspaceAwarePm) {
|
|
127
|
+
return { args: ['install'] };
|
|
128
|
+
}
|
|
129
|
+
/* non-workspace PMs: fall through to normal add */
|
|
83
130
|
}
|
|
84
|
-
|
|
131
|
+
}
|
|
132
|
+
// For workspace-aware PMs without package.json: prefer install over add
|
|
133
|
+
if (isWorkspaceAwarePm && packageName && !packageJsonContent) {
|
|
134
|
+
const newPkg = { dependencies: { [packageName]: tgzRelPath } };
|
|
135
|
+
return {
|
|
136
|
+
args: ['install'],
|
|
137
|
+
updatedPackageJson: JSON.stringify(newPkg, null, 2) + '\n',
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (isWorkspaceAwarePm) {
|
|
141
|
+
return { args: ['install'] };
|
|
85
142
|
}
|
|
86
143
|
return { args: [...pmArgs, tgzRelPath] };
|
|
87
144
|
}
|
|
88
|
-
function npmInstall(packagePath) {
|
|
145
|
+
function npmInstall(packagePath, packageName) {
|
|
89
146
|
return new Promise((resolve, reject) => {
|
|
90
147
|
const pm = detectPackageManager();
|
|
91
148
|
const pmName = path.basename(pm.cmd).replace(/\.(cmd|exe)$/, '');
|
|
@@ -98,6 +155,8 @@ function npmInstall(packagePath) {
|
|
|
98
155
|
pmArgs: pm.args,
|
|
99
156
|
cwd: process.cwd(),
|
|
100
157
|
packageJsonContent,
|
|
158
|
+
pmCmd: pm.cmd,
|
|
159
|
+
packageName,
|
|
101
160
|
});
|
|
102
161
|
if (result.updatedPackageJson) {
|
|
103
162
|
fs.writeFileSync(projectPkgPath, result.updatedPackageJson);
|
|
@@ -174,7 +233,7 @@ function clearBunCache(packageName) {
|
|
|
174
233
|
}
|
|
175
234
|
}
|
|
176
235
|
export async function handleInstallCommand(opts) {
|
|
177
|
-
const { packageToInstall, registry, generationFlags, downloadPackage } = opts;
|
|
236
|
+
const { packageToInstall, registry, generationFlags, downloadPackage, skipInstall } = opts;
|
|
178
237
|
// Keep cache by default — dependency packages are large (hl7.fhir.r4.core ~50 MB)
|
|
179
238
|
// and re-downloading them every run is the single biggest bottleneck.
|
|
180
239
|
// Users can opt in to cache cleanup with --no-cache.
|
|
@@ -229,8 +288,13 @@ export async function handleInstallCommand(opts) {
|
|
|
229
288
|
// Workaround: nuke the .bun cache entry so bun is forced to re-extract.
|
|
230
289
|
// See: https://github.com/oven-sh/bun/issues/29372
|
|
231
290
|
clearBunCache(packageName);
|
|
232
|
-
|
|
233
|
-
|
|
291
|
+
if (skipInstall) {
|
|
292
|
+
console.log(`Skipping install (--skip-install). Tarball saved to ./lib/${path.basename(tarballPath)}`);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
console.log(`Installing ${packageName}...`);
|
|
296
|
+
await npmInstall(tarballPath, packageName);
|
|
297
|
+
}
|
|
234
298
|
// Clean up extracted package tree (but keep the tarball under ./lib)
|
|
235
299
|
generationCleanup();
|
|
236
300
|
generationCleanup = undefined;
|
|
@@ -243,7 +307,7 @@ export async function handleInstallCommand(opts) {
|
|
|
243
307
|
if (generationFlags.noCache) {
|
|
244
308
|
cleanupCache();
|
|
245
309
|
}
|
|
246
|
-
console.log(`\n✓ Package ${packageToInstall} installed and ready to use!`);
|
|
310
|
+
console.log(`\n✓ Package ${packageToInstall} ${skipInstall ? 'generated' : 'installed'} and ready to use!`);
|
|
247
311
|
}
|
|
248
312
|
catch (error) {
|
|
249
313
|
// Clean up extracted package on error
|
|
@@ -353,10 +353,11 @@ export function processFields(ctx, fields, parentInterfaceName, parentFieldType,
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
// Conservative mode: if we failed to fetch base metadata (no base fields) skip emitting certain core properties
|
|
356
|
-
// to avoid degrading their types to primitives. Only skip if not profiled and
|
|
356
|
+
// to avoid degrading their types to primitives. Only skip if not profiled, not fixed, and no narrowing binding.
|
|
357
357
|
if (baseFieldByLastSegment.size === 0 && parentInterfaceName === interfaceName && fieldParts.length === 2 && fieldParts[0] === baseResource) {
|
|
358
358
|
const conservativeSkip = new Set(['gender', 'status', 'intent', 'hospitalization', 'payor', 'entry', 'concept', 'identifier', 'use', 'system', 'priority']);
|
|
359
|
-
|
|
359
|
+
const hasNarrowingBinding = !!(field.binding?.codes && field.binding.codes.length > 0 && field.binding.strength === 'required');
|
|
360
|
+
if (!field.isProfiled && field.fixedValue === undefined && !hasNarrowingBinding && conservativeSkip.has(fieldName)) {
|
|
360
361
|
debug('conservative skip (no base metadata)', field.name);
|
|
361
362
|
return;
|
|
362
363
|
}
|
|
@@ -13,10 +13,13 @@ export function handleFlatField(args) {
|
|
|
13
13
|
const conservative = baseFieldByLastSegment.size === 0;
|
|
14
14
|
const isRootInterface = parentInterfaceName === interfaceName;
|
|
15
15
|
const isNested = isRootInterface ? fieldParts.length > 1 : fieldParts.length >= 1;
|
|
16
|
+
// Does this field carry a narrowing required ValueSet binding with resolved codes?
|
|
17
|
+
// If so, it should bypass skip heuristics so we can emit a union literal type.
|
|
18
|
+
const hasNarrowingBinding = !!(field.binding?.codes && field.binding.codes.length > 0 && field.binding.strength === 'required');
|
|
16
19
|
// Skip deeply nested enumerated fields at root level - they'll be handled by nested interfaces
|
|
17
20
|
// (e.g., Patient.telecom.system should be emitted in UKCorePatientTelecom, not UKCorePatient)
|
|
18
21
|
const enumeratedCodeFields = new Set(['system', 'use', 'status', 'gender', 'intent', 'priority', 'class', 'category', 'clinicalStatus', 'verificationStatus']);
|
|
19
|
-
if (fieldParts.length >= 3 && enumeratedCodeFields.has(fieldName) && !field.fixedValue) {
|
|
22
|
+
if (fieldParts.length >= 3 && enumeratedCodeFields.has(fieldName) && !field.fixedValue && !hasNarrowingBinding) {
|
|
20
23
|
debug('skip deeply nested enumerated field at root level', field.name);
|
|
21
24
|
return true;
|
|
22
25
|
}
|
|
@@ -73,7 +76,7 @@ export function handleFlatField(args) {
|
|
|
73
76
|
// Even if cardinality or mustSupport changed, we should NOT emit if it would widen the type
|
|
74
77
|
// (e.g., base has category?: ('food'|'medication'|'environment'|'biologic')[] but we'd emit category: string[])
|
|
75
78
|
// TypeScript doesn't allow assigning string[] to a more specific string literal union array
|
|
76
|
-
if (isPrimitiveType(mapped) && !hasExtensionSlices && !hasIdentifierSlices && !field.isProfiled && !field.fixedValue) {
|
|
79
|
+
if (isPrimitiveType(mapped) && !hasExtensionSlices && !hasIdentifierSlices && !field.isProfiled && !field.fixedValue && !hasNarrowingBinding) {
|
|
77
80
|
debug('skip primitive override of base child - would widen type', field.name, 'mappedType=', mapped);
|
|
78
81
|
return true;
|
|
79
82
|
}
|
|
@@ -118,7 +121,7 @@ export function handleFlatField(args) {
|
|
|
118
121
|
const enumeratedSkip = new Set(['status', 'gender', 'class', 'category', 'concept', 'entry', 'clinicalStatus', 'verificationStatus', 'use', 'system', 'priority']);
|
|
119
122
|
const mustSupportChanged = baseField && (!baseField.mustSupport && field.mustSupport);
|
|
120
123
|
const cardinalityChanged = baseField && (baseField.isOptional !== field.isOptional || baseField.isArray !== field.isArray);
|
|
121
|
-
if (parentInterfaceName === interfaceName && !field.fixedValue && !mustSupportChanged && !cardinalityChanged) {
|
|
124
|
+
if (parentInterfaceName === interfaceName && !field.fixedValue && !hasNarrowingBinding && !mustSupportChanged && !cardinalityChanged) {
|
|
122
125
|
if (enumeratedSkip.has(fieldName))
|
|
123
126
|
return true;
|
|
124
127
|
if (baseResource === 'UsageContext' && fieldName === 'code' && field.type === 'string')
|
|
@@ -160,7 +163,7 @@ export function handleFlatField(args) {
|
|
|
160
163
|
}
|
|
161
164
|
// Special cases: known enumerated code fields (status, gender, intent, class, category) -> avoid overriding unless fixed or mustSupport changed
|
|
162
165
|
const mustSupportChanged = baseField.mustSupport !== field.mustSupport && field.mustSupport === true;
|
|
163
|
-
if (!field.fixedValue && !mustSupportChanged && ['status', 'gender', 'intent', 'class', 'category', 'lifecycleStatus', 'clinicalStatus', 'verificationStatus', 'use', 'system', 'priority'].includes(fieldName)) {
|
|
166
|
+
if (!field.fixedValue && !hasNarrowingBinding && !mustSupportChanged && ['status', 'gender', 'intent', 'class', 'category', 'lifecycleStatus', 'clinicalStatus', 'verificationStatus', 'use', 'system', 'priority'].includes(fieldName)) {
|
|
164
167
|
return true;
|
|
165
168
|
}
|
|
166
169
|
// CodeSystem.concept & Bundle.entry etc complex arrays: avoid overriding unless truly adding constraints
|
|
@@ -171,11 +174,12 @@ export function handleFlatField(args) {
|
|
|
171
174
|
if (['concept', 'entry', 'content'].includes(fieldName) && !field.fixedValue)
|
|
172
175
|
return true;
|
|
173
176
|
// Even if mustSupport changes, we should inherit the base enum type, not override with string
|
|
174
|
-
if (['gender', 'status', 'intent', 'lifecycleStatus', 'clinicalStatus', 'verificationStatus', 'content', 'use', 'system', 'priority'].includes(fieldName) && isPrimitiveType(mapped)) {
|
|
177
|
+
if (['gender', 'status', 'intent', 'lifecycleStatus', 'clinicalStatus', 'verificationStatus', 'content', 'use', 'system', 'priority'].includes(fieldName) && isPrimitiveType(mapped) && !hasNarrowingBinding) {
|
|
175
178
|
return true;
|
|
176
179
|
}
|
|
177
180
|
// Skip if identical to base (same type, array flag, optionality, AND mustSupport)
|
|
178
|
-
|
|
181
|
+
// Exception: fields with narrowing bindings should still be emitted (they constrain the type)
|
|
182
|
+
if (!field.fixedValue && !hasExtensionSlices && !hasNarrowingBinding) {
|
|
179
183
|
const mappedType = mapTypeToTS(field.type || 'string');
|
|
180
184
|
const mustSupportSame = baseField.mustSupport === field.mustSupport;
|
|
181
185
|
if ((baseField.type === field.type || baseField.type === mappedType) && baseField.isArray === field.isArray && baseField.isOptional === field.isOptional && mustSupportSame) {
|
|
@@ -449,6 +453,25 @@ export function handleFlatField(args) {
|
|
|
449
453
|
}
|
|
450
454
|
// Apply ValueSet binding constraints for CodeableConcept types
|
|
451
455
|
fieldType = applyBindingConstraint(fieldType, field, fields);
|
|
456
|
+
// Apply ValueSet binding constraints for primitive code fields (generates union literal type)
|
|
457
|
+
if (isPrimitiveType(fieldType) && hasNarrowingBinding && field.binding?.codes) {
|
|
458
|
+
const vsUri = field.binding.uri?.split('|')[0];
|
|
459
|
+
const vs = vsUri && valueSets ? (valueSets.get(vsUri) || valueSets.get(field.binding.uri)) : undefined;
|
|
460
|
+
if (vs && vs.isSmall && vs.concepts.length > 0) {
|
|
461
|
+
// Import the ValueSet Code type from the generated valuesets directory
|
|
462
|
+
const sanitizedVSName = sanitizeValueSetName(vs.name);
|
|
463
|
+
const vsTypeName = `${sanitizedVSName}Code`;
|
|
464
|
+
importManager.addPathBasedImport(vsTypeName, './valuesets/ValueSet-' + sanitizedVSName);
|
|
465
|
+
fieldType = vsTypeName;
|
|
466
|
+
debug(`Applied code binding constraint for ${field.name}: ${vsTypeName}`);
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
// Fall back to inline union from binding.codes (wrap in parens for array compatibility)
|
|
470
|
+
const inlineUnion = field.binding.codes.map(c => JSON.stringify(c.code)).join(' | ');
|
|
471
|
+
fieldType = field.binding.codes.length > 1 ? `(${inlineUnion})` : inlineUnion;
|
|
472
|
+
debug(`Applied inline code binding constraint for ${field.name}: ${fieldType}`);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
452
475
|
// Preserve arrayness from base when known; if base metadata is missing and field name is a known repeating element (e.g., 'coverage' on Account),
|
|
453
476
|
// default to array to avoid incorrect narrowing.
|
|
454
477
|
// Skip adding [] if fieldType already contains array syntax (e.g., from identifier/extension union types)
|
package/out/src/main.js
CHANGED
|
@@ -61,6 +61,7 @@ function printUsage() {
|
|
|
61
61
|
console.log(" --prefab-styles <path> Path to styles module (.ts/.js) copied into the generated prefab/ folder");
|
|
62
62
|
console.log(" --recursive (update only) Recursively search subdirectories for lib/ folders");
|
|
63
63
|
console.log(" --force (update only) Force regeneration even if version and flags haven't changed");
|
|
64
|
+
console.log(" --skip-install (install only) Generate tarball without running package manager install");
|
|
64
65
|
console.log(" --outDir <dir> Output directory (alias for second positional argument)");
|
|
65
66
|
console.log(" --fhir-version <ver> FHIR version to target: r4, r4b, or r5 (auto-detected from package if omitted)");
|
|
66
67
|
console.log(" --package <pkg[@version]> Download FHIR package from registry and process it (latest if no version)");
|
|
@@ -230,6 +231,10 @@ export function parseCliArgs(argv) {
|
|
|
230
231
|
out.flags.noClient = true;
|
|
231
232
|
continue;
|
|
232
233
|
}
|
|
234
|
+
if (arg === '--skip-install') {
|
|
235
|
+
out.flags.skipInstall = true;
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
233
238
|
if (arg === '--dicomweb') {
|
|
234
239
|
out.flags.dicomweb = true;
|
|
235
240
|
continue;
|
|
@@ -410,6 +415,7 @@ export async function run() {
|
|
|
410
415
|
registry,
|
|
411
416
|
generationFlags,
|
|
412
417
|
downloadPackage,
|
|
418
|
+
skipInstall: !!generationFlags.skipInstall,
|
|
413
419
|
});
|
|
414
420
|
}
|
|
415
421
|
return;
|
|
@@ -429,7 +435,8 @@ export async function run() {
|
|
|
429
435
|
packageToInstall,
|
|
430
436
|
registry,
|
|
431
437
|
generationFlags,
|
|
432
|
-
downloadPackage
|
|
438
|
+
downloadPackage,
|
|
439
|
+
skipInstall: !!generationFlags.skipInstall,
|
|
433
440
|
});
|
|
434
441
|
return;
|
|
435
442
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babelfhir-ts",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"description": "BabelFHIR-TS: generate TypeScript interfaces, validators, and helper classes from FHIR R4/R4B/R5 StructureDefinitions (profiles) directly inside package archives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/src/main.js",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"zod": "^4.3.6"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@types/fhir": "^0.0.
|
|
101
|
+
"@types/fhir": "^0.0.43",
|
|
102
102
|
"consola": "^3.4.2",
|
|
103
103
|
"fhirpath": "^4.10.0",
|
|
104
104
|
"tar": "^7.4.3",
|