From 2294bf45ed87b7e453b1d34f76068c48d8b5a3f3 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sat, 4 Jan 2025 03:07:12 +0300 Subject: [PATCH] #320: Fix tree shaking mechanism and remove circular dependencies (#343) - Improved the tree shaking process to ensure unused code is properly eliminated across the entire library. - Refactored the codebase to resolve circular dependencies, improving tree shaking and maintainability. --- src/agile/client/agileClient.ts | 30 ++-- src/serviceDesk/client/serviceDeskClient.ts | 2 +- src/version2/client/version2Client.ts | 174 ++++++++++--------- src/version3/client/version3Client.ts | 176 ++++++++++---------- src/version3/models/index.ts | 1 - 5 files changed, 188 insertions(+), 195 deletions(-) diff --git a/src/agile/client/agileClient.ts b/src/agile/client/agileClient.ts index 7f98f186ac..7710296e3c 100644 --- a/src/agile/client/agileClient.ts +++ b/src/agile/client/agileClient.ts @@ -1,19 +1,17 @@ -import { BaseClient } from '../../clients'; -import { - Backlog, - Board, - Builds, - Deployments, - DevelopmentInformation, - DevopsComponents, - Epic, - FeatureFlags, - Issue, - Operations, - RemoteLinks, - SecurityInformation, - Sprint, -} from '..'; +import { BaseClient } from '../../clients/baseClient'; +import { Backlog } from '../backlog'; +import { Board } from '../board'; +import { Builds } from '../builds'; +import { Deployments } from '../deployments'; +import { DevelopmentInformation } from '../developmentInformation'; +import { DevopsComponents } from '../devopsComponents'; +import { Epic } from '../epic'; +import { FeatureFlags } from '../featureFlags'; +import { Issue } from '../issue'; +import { Operations } from '../operations'; +import { RemoteLinks } from '../remoteLinks'; +import { SecurityInformation } from '../securityInformation'; +import { Sprint } from '../sprint'; export class AgileClient extends BaseClient { backlog = new Backlog(this); diff --git a/src/serviceDesk/client/serviceDeskClient.ts b/src/serviceDesk/client/serviceDeskClient.ts index c131004659..c3abefccbb 100644 --- a/src/serviceDesk/client/serviceDeskClient.ts +++ b/src/serviceDesk/client/serviceDeskClient.ts @@ -1,4 +1,4 @@ -import { BaseClient } from '../../clients'; +import { BaseClient } from '../../clients/baseClient'; import { Customer } from '../customer'; import { Info } from '../info'; import { Insight } from '../insight'; diff --git a/src/version2/client/version2Client.ts b/src/version2/client/version2Client.ts index f2fe264178..a7413e6940 100644 --- a/src/version2/client/version2Client.ts +++ b/src/version2/client/version2Client.ts @@ -1,91 +1,89 @@ -import { BaseClient } from '../../clients'; -import { - AnnouncementBanner, - ApplicationRoles, - AppMigration, - AppProperties, - AuditRecords, - Avatars, - Dashboards, - DynamicModules, - Filters, - FilterSharing, - GroupAndUserPicker, - Groups, - IssueAttachments, - IssueCommentProperties, - IssueComments, - IssueCustomFieldConfigurationApps, - IssueCustomFieldContexts, - IssueCustomFieldOptions, - IssueCustomFieldOptionsApps, - IssueCustomFieldValuesApps, - IssueFieldConfigurations, - IssueFields, - IssueLinks, - IssueLinkTypes, - IssueNavigatorSettings, - IssueNotificationSchemes, - IssuePriorities, - IssueProperties, - IssueRemoteLinks, - IssueResolutions, - Issues, - IssueSearch, - IssueSecurityLevel, - IssueSecuritySchemes, - IssueTypeProperties, - IssueTypes, - IssueTypeSchemes, - IssueTypeScreenSchemes, - IssueVotes, - IssueWatchers, - IssueWorklogProperties, - IssueWorklogs, - JiraExpressions, - JiraSettings, - JQL, - JqlFunctionsApps, - Labels, - LicenseMetrics, - Myself, - Permissions, - PermissionSchemes, - ProjectAvatars, - ProjectCategories, - ProjectComponents, - ProjectEmail, - ProjectFeatures, - ProjectKeyAndNameValidation, - ProjectPermissionSchemes, - ProjectProperties, - ProjectRoleActors, - ProjectRoles, - Projects, - ProjectTypes, - ProjectVersions, - Screens, - ScreenSchemes, - ScreenTabFields, - ScreenTabs, - ServerInfo, - Status, - Tasks, - TimeTracking, - UIModificationsApps, - UserProperties, - Users, - UserSearch, - Webhooks, - Workflows, - WorkflowSchemeDrafts, - WorkflowSchemeProjectAssociations, - WorkflowSchemes, - WorkflowStatusCategories, - WorkflowStatuses, - WorkflowTransitionProperties, - WorkflowTransitionRules, -} from '..'; +import { BaseClient } from '../../clients/baseClient'; +import { AnnouncementBanner } from '../announcementBanner'; +import { ApplicationRoles } from '../applicationRoles'; +import { AppMigration } from '../appMigration'; +import { AppProperties } from '../appProperties'; +import { AuditRecords } from '../auditRecords'; +import { Avatars } from '../avatars'; +import { Dashboards } from '../dashboards'; +import { DynamicModules } from '../dynamicModules'; +import { Filters } from '../filters'; +import { FilterSharing } from '../filterSharing'; +import { GroupAndUserPicker } from '../groupAndUserPicker'; +import { Groups } from '../groups'; +import { IssueAttachments } from '../issueAttachments'; +import { IssueCommentProperties } from '../issueCommentProperties'; +import { IssueComments } from '../issueComments'; +import { IssueCustomFieldConfigurationApps } from '../issueCustomFieldConfigurationApps'; +import { IssueCustomFieldContexts } from '../issueCustomFieldContexts'; +import { IssueCustomFieldOptions } from '../issueCustomFieldOptions'; +import { IssueCustomFieldOptionsApps } from '../issueCustomFieldOptionsApps'; +import { IssueCustomFieldValuesApps } from '../issueCustomFieldValuesApps'; +import { IssueFieldConfigurations } from '../issueFieldConfigurations'; +import { IssueFields } from '../issueFields'; +import { IssueLinks } from '../issueLinks'; +import { IssueLinkTypes } from '../issueLinkTypes'; +import { IssueNavigatorSettings } from '../issueNavigatorSettings'; +import { IssueNotificationSchemes } from '../issueNotificationSchemes'; +import { IssuePriorities } from '../issuePriorities'; +import { IssueProperties } from '../issueProperties'; +import { IssueRemoteLinks } from '../issueRemoteLinks'; +import { IssueResolutions } from '../issueResolutions'; +import { Issues } from '../issues'; +import { IssueSearch } from '../issueSearch'; +import { IssueSecurityLevel } from '../issueSecurityLevel'; +import { IssueSecuritySchemes } from '../issueSecuritySchemes'; +import { IssueTypeProperties } from '../issueTypeProperties'; +import { IssueTypes } from '../issueTypes'; +import { IssueTypeSchemes } from '../issueTypeSchemes'; +import { IssueTypeScreenSchemes } from '../issueTypeScreenSchemes'; +import { IssueVotes } from '../issueVotes'; +import { IssueWatchers } from '../issueWatchers'; +import { IssueWorklogProperties } from '../issueWorklogProperties'; +import { IssueWorklogs } from '../issueWorklogs'; +import { JiraExpressions } from '../jiraExpressions'; +import { JiraSettings } from '../jiraSettings'; +import { JQL } from '../jQL'; +import { JqlFunctionsApps } from '../jqlFunctionsApps'; +import { Labels } from '../labels'; +import { LicenseMetrics } from '../licenseMetrics'; +import { Myself } from '../myself'; +import { Permissions } from '../permissions'; +import { PermissionSchemes } from '../permissionSchemes'; +import { ProjectAvatars } from '../projectAvatars'; +import { ProjectCategories } from '../projectCategories'; +import { ProjectComponents } from '../projectComponents'; +import { ProjectEmail } from '../projectEmail'; +import { ProjectFeatures } from '../projectFeatures'; +import { ProjectKeyAndNameValidation } from '../projectKeyAndNameValidation'; +import { ProjectPermissionSchemes } from '../projectPermissionSchemes'; +import { ProjectProperties } from '../projectProperties'; +import { ProjectRoleActors } from '../projectRoleActors'; +import { ProjectRoles } from '../projectRoles'; +import { Projects } from '../projects'; +import { ProjectTypes } from '../projectTypes'; +import { ProjectVersions } from '../projectVersions'; +import { Screens } from '../screens'; +import { ScreenSchemes } from '../screenSchemes'; +import { ScreenTabFields } from '../screenTabFields'; +import { ScreenTabs } from '../screenTabs'; +import { ServerInfo } from '../serverInfo'; +import { Status } from '../status'; +import { Tasks } from '../tasks'; +import { TimeTracking } from '../timeTracking'; +import { UIModificationsApps } from '../uIModificationsApps'; +import { UserProperties } from '../userProperties'; +import { Users } from '../users'; +import { UserSearch } from '../userSearch'; +import { Webhooks } from '../webhooks'; +import { Workflows } from '../workflows'; +import { WorkflowSchemeDrafts } from '../workflowSchemeDrafts'; +import { WorkflowSchemeProjectAssociations } from '../workflowSchemeProjectAssociations'; +import { WorkflowSchemes } from '../workflowSchemes'; +import { WorkflowStatusCategories } from '../workflowStatusCategories'; +import { WorkflowStatuses } from '../workflowStatuses'; +import { WorkflowTransitionProperties } from '../workflowTransitionProperties'; +import { WorkflowTransitionRules } from '../workflowTransitionRules'; export class Version2Client extends BaseClient { announcementBanner = new AnnouncementBanner(this); diff --git a/src/version3/client/version3Client.ts b/src/version3/client/version3Client.ts index e991ff1cc6..25fb690877 100644 --- a/src/version3/client/version3Client.ts +++ b/src/version3/client/version3Client.ts @@ -1,92 +1,90 @@ -import { BaseClient } from '../../clients'; -import { - AnnouncementBanner, - ApplicationRoles, - AppMigration, - AppProperties, - AuditRecords, - Avatars, - Dashboards, - DynamicModules, - Filters, - FilterSharing, - GroupAndUserPicker, - Groups, - InstanceInformation, - IssueAttachments, - IssueCommentProperties, - IssueComments, - IssueCustomFieldConfigurationApps, - IssueCustomFieldContexts, - IssueCustomFieldOptions, - IssueCustomFieldOptionsApps, - IssueCustomFieldValuesApps, - IssueFieldConfigurations, - IssueFields, - IssueLinks, - IssueLinkTypes, - IssueNavigatorSettings, - IssueNotificationSchemes, - IssuePriorities, - IssueProperties, - IssueRemoteLinks, - IssueResolutions, - Issues, - IssueSearch, - IssueSecurityLevel, - IssueSecuritySchemes, - IssueTypeProperties, - IssueTypes, - IssueTypeSchemes, - IssueTypeScreenSchemes, - IssueVotes, - IssueWatchers, - IssueWorklogProperties, - IssueWorklogs, - JiraExpressions, - JiraSettings, - JQL, - JqlFunctionsApps, - Labels, - LicenseMetrics, - Myself, - Permissions, - PermissionSchemes, - ProjectAvatars, - ProjectCategories, - ProjectComponents, - ProjectEmail, - ProjectFeatures, - ProjectKeyAndNameValidation, - ProjectPermissionSchemes, - ProjectProperties, - ProjectRoleActors, - ProjectRoles, - Projects, - ProjectTypes, - ProjectVersions, - Screens, - ScreenSchemes, - ScreenTabFields, - ScreenTabs, - ServerInfo, - Status, - Tasks, - TimeTracking, - UIModificationsApps, - UserProperties, - Users, - UserSearch, - Webhooks, - Workflows, - WorkflowSchemeDrafts, - WorkflowSchemeProjectAssociations, - WorkflowSchemes, - WorkflowStatusCategories, - WorkflowStatuses, - WorkflowTransitionProperties, - WorkflowTransitionRules, -} from '..'; +import { BaseClient } from '../../clients/baseClient'; +import { AnnouncementBanner } from '../announcementBanner'; +import { AppMigration } from '../appMigration'; +import { AppProperties } from '../appProperties'; +import { ApplicationRoles } from '../applicationRoles'; +import { AuditRecords } from '../auditRecords'; +import { Avatars } from '../avatars'; +import { Dashboards } from '../dashboards'; +import { DynamicModules } from '../dynamicModules'; +import { FilterSharing } from '../filterSharing'; +import { Filters } from '../filters'; +import { GroupAndUserPicker } from '../groupAndUserPicker'; +import { Groups } from '../groups'; +import { InstanceInformation } from '../instanceInformation'; +import { IssueAttachments } from '../issueAttachments'; +import { IssueCommentProperties } from '../issueCommentProperties'; +import { IssueComments } from '../issueComments'; +import { IssueCustomFieldConfigurationApps } from '../issueCustomFieldConfigurationApps'; +import { IssueCustomFieldContexts } from '../issueCustomFieldContexts'; +import { IssueCustomFieldOptions } from '../issueCustomFieldOptions'; +import { IssueCustomFieldOptionsApps } from '../issueCustomFieldOptionsApps'; +import { IssueCustomFieldValuesApps } from '../issueCustomFieldValuesApps'; +import { IssueFieldConfigurations } from '../issueFieldConfigurations'; +import { IssueFields } from '../issueFields'; +import { IssueLinkTypes } from '../issueLinkTypes'; +import { IssueLinks } from '../issueLinks'; +import { IssueNavigatorSettings } from '../issueNavigatorSettings'; +import { IssueNotificationSchemes } from '../issueNotificationSchemes'; +import { IssuePriorities } from '../issuePriorities'; +import { IssueProperties } from '../issueProperties'; +import { IssueRemoteLinks } from '../issueRemoteLinks'; +import { IssueResolutions } from '../issueResolutions'; +import { IssueSearch } from '../issueSearch'; +import { IssueSecurityLevel } from '../issueSecurityLevel'; +import { IssueSecuritySchemes } from '../issueSecuritySchemes'; +import { IssueTypeProperties } from '../issueTypeProperties'; +import { IssueTypeSchemes } from '../issueTypeSchemes'; +import { IssueTypeScreenSchemes } from '../issueTypeScreenSchemes'; +import { IssueTypes } from '../issueTypes'; +import { IssueVotes } from '../issueVotes'; +import { IssueWatchers } from '../issueWatchers'; +import { IssueWorklogProperties } from '../issueWorklogProperties'; +import { IssueWorklogs } from '../issueWorklogs'; +import { Issues } from '../issues'; +import { JiraExpressions } from '../jiraExpressions'; +import { JiraSettings } from '../jiraSettings'; +import { JQL } from '../jQL'; +import { JqlFunctionsApps } from '../jqlFunctionsApps'; +import { Labels } from '../labels'; +import { LicenseMetrics } from '../licenseMetrics'; +import { Myself } from '../myself'; +import { PermissionSchemes } from '../permissionSchemes'; +import { Permissions } from '../permissions'; +import { ProjectAvatars } from '../projectAvatars'; +import { ProjectCategories } from '../projectCategories'; +import { ProjectComponents } from '../projectComponents'; +import { ProjectEmail } from '../projectEmail'; +import { ProjectFeatures } from '../projectFeatures'; +import { ProjectKeyAndNameValidation } from '../projectKeyAndNameValidation'; +import { ProjectPermissionSchemes } from '../projectPermissionSchemes'; +import { ProjectProperties } from '../projectProperties'; +import { ProjectRoleActors } from '../projectRoleActors'; +import { ProjectRoles } from '../projectRoles'; +import { ProjectTypes } from '../projectTypes'; +import { ProjectVersions } from '../projectVersions'; +import { Projects } from '../projects'; +import { ScreenSchemes } from '../screenSchemes'; +import { ScreenTabFields } from '../screenTabFields'; +import { ScreenTabs } from '../screenTabs'; +import { Screens } from '../screens'; +import { ServerInfo } from '../serverInfo'; +import { Status } from '../status'; +import { Tasks } from '../tasks'; +import { TimeTracking } from '../timeTracking'; +import { UIModificationsApps } from '../uIModificationsApps'; +import { UserProperties } from '../userProperties'; +import { UserSearch } from '../userSearch'; +import { Users } from '../users'; +import { Webhooks } from '../webhooks'; +import { Workflows } from '../workflows'; +import { WorkflowSchemeDrafts } from '../workflowSchemeDrafts'; +import { WorkflowSchemeProjectAssociations } from '../workflowSchemeProjectAssociations'; +import { WorkflowSchemes } from '../workflowSchemes'; +import { WorkflowStatusCategories } from '../workflowStatusCategories'; +import { WorkflowStatuses } from '../workflowStatuses'; +import { WorkflowTransitionProperties } from '../workflowTransitionProperties'; +import { WorkflowTransitionRules } from '../workflowTransitionRules'; export class Version3Client extends BaseClient { announcementBanner = new AnnouncementBanner(this); diff --git a/src/version3/models/index.ts b/src/version3/models/index.ts index 45c21ade21..68860e2b33 100644 --- a/src/version3/models/index.ts +++ b/src/version3/models/index.ts @@ -155,7 +155,6 @@ export * from './icon'; export * from './id'; export * from './idOrKey'; export * from './includedFields'; -export * from './index'; export * from './issue'; export * from './issueArchivalSync'; export * from './issueArchivalSyncRequest';