diff --git a/server/artifactory-service.ts b/server/artifactory-service.ts index 73f4e0b..dc0a40f 100644 --- a/server/artifactory-service.ts +++ b/server/artifactory-service.ts @@ -30,7 +30,6 @@ configService interface AdditionalCode { readme: string; - mainCode: string | undefined; fileList; } @@ -63,16 +62,6 @@ function readme2Html(readmeFile: string): string { return html; } -function readMainCode(storageDir: string): string { - const packageJson = fs.readJSONSync(path.join(storageDir, `package.json`)); - try { - return fs.readFileSync(path.join(storageDir, packageJson.main)).toString(); - } catch (error) { - console.error(`MainCode file not found: ${storageDir}`); - return null; - } -} - function fetchPackages(): AxiosPromise { if (process.env.MOCK) { return new Promise((resolve, reject) => { @@ -121,7 +110,6 @@ async function getPackageDetail({ } resolve({ readme: data, - mainCode: readMainCode(path.join(__dirname, '..', '..')), fileList: [], }); }) @@ -177,18 +165,12 @@ async function getPackageDetail({ async function readAdditionalCode(storageDir: string): Promise { let readme; - let mainCode; let fileList; try { readme = readme2Html(path.join(storageDir, 'package', 'README.md')); } catch (error) { readme = undefined; } - try { - mainCode = readMainCode(path.join(storageDir, 'package')); - } catch (error) { - mainCode = undefined; - } try { fileList = await getFiles(storageDir, 'package', false); } catch { @@ -196,7 +178,6 @@ async function readAdditionalCode(storageDir: string): Promise { } return { readme, - mainCode, fileList, }; } diff --git a/src/views/PackageDetail.vue b/src/views/PackageDetail.vue index 5f62763..bacbec3 100644 --- a/src/views/PackageDetail.vue +++ b/src/views/PackageDetail.vue @@ -46,7 +46,7 @@ - +

Scripts

diff --git a/types/Package.ts b/types/Package.ts index e99ede3..4bb33c7 100644 --- a/types/Package.ts +++ b/types/Package.ts @@ -58,7 +58,6 @@ export default class Package extends Searchable implements PackageMetaDataDTO { public readonly bugTrackerUrl?: string; public readonly dependenciesCount: number; public readonly scope: string | undefined; - public readonly mainCode: string | undefined; public readonly fileList?: TreeItem[]; private craftersList: Crafter[]; private tagList: Tag[];