From 486e77b4f7a9f1d70800cdd3ad5afe0424005785 Mon Sep 17 00:00:00 2001 From: Ravi <7014230+arelra@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:48:30 +0100 Subject: [PATCH] Remove unused exports (#1612) * Remove unused exports * Fix imports from core * Changeset --- .changeset/swift-jars-drop.md | 5 ++ src/core/index.ts | 76 +++---------------- src/init/consented/messenger.ts | 2 +- src/init/consentless.ts | 2 +- .../prebid/improve-digital.spec.ts | 2 +- src/lib/header-bidding/prebid/magnite.spec.ts | 2 +- 6 files changed, 18 insertions(+), 71 deletions(-) create mode 100644 .changeset/swift-jars-drop.md diff --git a/.changeset/swift-jars-drop.md b/.changeset/swift-jars-drop.md new file mode 100644 index 000000000..66116b593 --- /dev/null +++ b/.changeset/swift-jars-drop.md @@ -0,0 +1,5 @@ +--- +'@guardian/commercial': patch +--- + +Removed unused exports diff --git a/src/core/index.ts b/src/core/index.ts index e3accc596..9e0664469 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -1,74 +1,16 @@ -/* istanbul ignore file -- there's no point check this for test coverage */ - -export { ias } from './third-party-tags/ias'; -export { permutive } from './third-party-tags/permutive'; -export { twitter } from './third-party-tags/twitter-uwt'; -export { inizio } from './third-party-tags/inizio'; -export { remarketing } from './third-party-tags/remarketing'; +export { isAdBlockInUse } from './detect-ad-blocker'; export { EventTimer } from './event-timer'; +export { adSizes } from './ad-sizes'; +export * as constants from './constants'; export { bypassCommercialMetricsSampling, initCommercialMetrics, } from './send-commercial-metrics'; -export type { ThirdPartyTag } from './types'; -export { - adSizes, - createAdSize, - getAdSize, - outstreamSizes, - slotSizeMappings, - standardAdSizes, -} from './ad-sizes'; -export { isBreakpoint } from './lib/breakpoint'; -export type { Breakpoint } from './lib/breakpoint'; -export type { - SizeKeys, - AdSizeString, - AdSize, - SizeMapping, - SlotSizeMappings, - SlotName, -} from './ad-sizes'; -export { isAdBlockInUse } from './detect-ad-blocker'; -export { - clearPermutiveSegments, - getPermutiveSegments, - getPermutivePFPSegments, -} from './permutive'; -export { initTrackScrollDepth } from './track-scroll-depth'; -export { initTrackGpcSignal } from './track-gpc-signal'; -export { createAdSlot, concatSizeMappings } from '../core/create-ad-slot'; -export type { - AdsConfig, - AdsConfigBasic, - AdsConfigDisabled, - AdTargetingBuilder, - CustomParams, -} from './types'; -export * as constants from './constants'; -export type { ContentTargeting } from './targeting/content'; -export { getContentTargeting } from './targeting/content'; -export type { PersonalisedTargeting } from './targeting/personalised'; -export { getPersonalisedTargeting } from './targeting/personalised'; -export type { SessionTargeting } from './targeting/session'; -export { getSessionTargeting } from './targeting/session'; -export type { SharedTargeting } from './targeting/shared'; -export { getSharedTargeting } from './targeting/shared'; -export type { ViewportTargeting } from './targeting/viewport'; -export { getViewportTargeting } from './targeting/viewport'; -export { pickTargetingValues } from './targeting/pick-targeting-values'; -export { init as initMessenger } from './messenger'; -export type { - RegisterListener, - RegisterPersistentListener, - RespondProxy, -} from './messenger'; -export { postMessage } from './messenger/post-message'; export { buildPageTargeting } from './targeting/build-page-targeting'; -export { buildPageTargetingConsentless } from './targeting/build-page-targeting-consentless'; -export type { PageTargeting } from './targeting/build-page-targeting'; -/* -- Vendor JavaScript -- */ -export { a9Apstag } from './__vendor/a9-apstag'; -export { ipsosMoriStub } from './__vendor/ipsos-mori'; -export { pubmatic } from './__vendor/pubmatic'; +export { postMessage } from './messenger/post-message'; export { buildImaAdTagUrl } from './targeting/youtube-ima'; +export { getPermutivePFPSegments } from './permutive'; +export type { AdsConfigDisabled } from './types'; +export type { AdSize, SizeMapping, SlotName } from './ad-sizes'; +export type { PageTargeting } from './targeting/build-page-targeting'; +export type { AdsConfigCCPAorAus, AdsConfigTCFV2 } from './types'; diff --git a/src/init/consented/messenger.ts b/src/init/consented/messenger.ts index 152f3e05e..537960d2e 100644 --- a/src/init/consented/messenger.ts +++ b/src/init/consented/messenger.ts @@ -1,4 +1,4 @@ -import { initMessenger } from 'core'; +import { init as initMessenger } from 'core/messenger'; import { init as background } from 'core/messenger/background'; import { init as disableRefresh } from 'core/messenger/disable-refresh'; import { init as fullwidth } from 'core/messenger/full-width'; diff --git a/src/init/consentless.ts b/src/init/consentless.ts index 0bc2f7bcd..12ffc04c5 100644 --- a/src/init/consentless.ts +++ b/src/init/consentless.ts @@ -1,5 +1,5 @@ import type { ConsentState } from '@guardian/libs'; -import { initMessenger } from 'core'; +import { init as initMessenger } from 'core/messenger'; import { init as background } from 'core/messenger/background'; import { init as resize } from 'core/messenger/resize'; import { init as type } from 'core/messenger/type'; diff --git a/src/lib/header-bidding/prebid/improve-digital.spec.ts b/src/lib/header-bidding/prebid/improve-digital.spec.ts index a818aae00..1dca3218b 100644 --- a/src/lib/header-bidding/prebid/improve-digital.spec.ts +++ b/src/lib/header-bidding/prebid/improve-digital.spec.ts @@ -1,4 +1,4 @@ -import { createAdSize } from 'core'; +import { createAdSize } from 'core/ad-sizes'; import { isInAuOrNz as isInAuOrNz_, isInRow as isInRow_, diff --git a/src/lib/header-bidding/prebid/magnite.spec.ts b/src/lib/header-bidding/prebid/magnite.spec.ts index d7c5b1cf6..9260f444c 100644 --- a/src/lib/header-bidding/prebid/magnite.spec.ts +++ b/src/lib/header-bidding/prebid/magnite.spec.ts @@ -1,4 +1,4 @@ -import { createAdSize } from 'core'; +import { createAdSize } from 'core/ad-sizes'; import { isInAuOrNz as isInAuOrNz_, isInRow as isInRow_,