Skip to content

Commit e5e83dc

Browse files
committed
ref: Remove dead code found by knip
- Remove unused fhirToPackageMeta, npmToPackageMeta from typeschema/types.ts - Remove unused TypeschemaGeneratorOptions interface from typeschema/types.ts - Remove unused typeSchemaInfo from writer-generator/utils.ts - Remove unused CLIArgv interface from cli/commands/index.ts - Remove unused tinyglobby dependency
1 parent 183067b commit e5e83dc

5 files changed

Lines changed: 0 additions & 38 deletions

File tree

bun.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"@atomic-ehr/fhirschema": "^0.0.8",
7070
"mustache": "^4.2.0",
7171
"picocolors": "^1.1.1",
72-
"tinyglobby": "^0.2.15",
7372
"yaml": "^2.8.2",
7473
"yargs": "^18.0.0"
7574
},

src/api/writer-generator/utils.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { TypeSchema } from "@root/typeschema";
2-
31
export const words = (s: string) => {
42
return s.split(/(?<=[a-z])(?=[A-Z])|[-_.\s]/).filter(Boolean);
53
};
@@ -63,7 +61,3 @@ export function deepEqual<T>(obj1: T, obj2: T): boolean {
6361

6462
return keys1.every((key) => keys2.includes(key) && deepEqual(obj1[key], obj2[key]));
6563
}
66-
67-
export const typeSchemaInfo = (schema: TypeSchema): string => {
68-
return `<${schema.identifier.url}> from ${schema.identifier.package}#${schema.identifier.version}`;
69-
};

src/cli/commands/index.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@ import yargs from "yargs";
1313
import { hideBin } from "yargs/helpers";
1414
import { typeschemaCommand } from "./typeschema";
1515

16-
/**
17-
* CLI arguments interface
18-
*/
19-
export interface CLIArgv {
20-
verbose?: boolean;
21-
debug?: boolean;
22-
logLevel?: LogLevel;
23-
}
24-
2516
let cliLogger = mkLogger({ prefix: "cli" });
2617

2718
async function setupLoggingMiddleware(argv: any) {

src/typeschema/types.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
*/
55

66
import { createHash } from "node:crypto";
7-
import type { CanonicalManager } from "@atomic-ehr/fhir-canonical-manager";
87
import type * as FS from "@atomic-ehr/fhirschema";
98
import type { StructureDefinition, ValueSet, ValueSetCompose } from "@root/fhir-types/hl7-fhir-r4-core";
10-
import type { CodegenLog } from "@root/utils/log";
119

1210
export type Name = string & { readonly __brand: unique symbol };
1311
export type CanonicalUrl = string & { readonly __brand: unique symbol };
@@ -47,16 +45,6 @@ export const packageMeta = (schema: TypeSchema): PackageMeta => {
4745
};
4846
export const packageMetaToFhir = (packageMeta: PackageMeta) => `${packageMeta.name}#${packageMeta.version}`;
4947
export const packageMetaToNpm = (packageMeta: PackageMeta) => `${packageMeta.name}@${packageMeta.version}`;
50-
export const fhirToPackageMeta = (fhir: string) => {
51-
const [name, version] = fhir.split("#");
52-
if (!name) throw new Error(`Invalid FHIR package meta: ${fhir}`);
53-
return { name, version: version ?? "latest" };
54-
};
55-
export const npmToPackageMeta = (fhir: string) => {
56-
const [name, version] = fhir.split("@");
57-
if (!name) throw new Error(`Invalid FHIR package meta: ${fhir}`);
58-
return { name, version: version ?? "latest" };
59-
};
6048

6149
export const hashSchema = (schema: TypeSchema): string => {
6250
const json = JSON.stringify(schema);
@@ -426,11 +414,3 @@ export const enrichValueSet = (vs: ValueSet, packageMeta: PackageMeta): RichValu
426414
};
427415

428416
///////////////////////////////////////////////////////////
429-
430-
export interface TypeschemaGeneratorOptions {
431-
logger?: CodegenLog;
432-
treeshake?: string[];
433-
manager: ReturnType<typeof CanonicalManager>;
434-
/** Custom FHIR package registry URL */
435-
registry?: string;
436-
}

0 commit comments

Comments
 (0)