Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/createImports.mts
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
import ts from "typescript";
import { posix } from "path";
import { Service } from "./service.mjs";
import { Project } from "ts-morph";

const { join } = posix;

export const createImports = ({
service,
serviceEndName,
project,
}: {
service: Service;
serviceEndName: string;
project: Project;
}) => {
const { klasses } = service;
// get all class names
const classNames = klasses.map(({ className }) => className);
// remove duplicates
const uniqueClassNames = [...new Set(classNames)];

const modelsFile = project
.getSourceFiles()
.find((sourceFile) => sourceFile.getFilePath().includes("models.ts"));
Expand Down
2 changes: 1 addition & 1 deletion src/createSource.mts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const createSourceFile = async (outputPath: string, serviceEndName: string) => {
const service = await getServices(project);

const imports = createImports({
service,
serviceEndName,
project,
});

const exports = createExports(service);

const commonSource = ts.factory.createSourceFile(
Expand Down